fix(core): In apps.bitcoin ensure that get_address() fails for multisig if user's public key is not included.

release/21.02
Andrew Kozlik 4 years ago committed by Tomas Susanka
parent 44c7d23741
commit 77f5e90466

@ -23,16 +23,15 @@ def get_address(
node: bip32.HDNode,
multisig: MultisigRedeemScriptType = None,
) -> str:
if multisig:
# Ensure that our public key is included in the multisig.
multisig_pubkey_index(multisig, node.public_key())
if (
script_type == InputScriptType.SPENDADDRESS
or script_type == InputScriptType.SPENDMULTISIG
):
if multisig: # p2sh multisig
pubkey = node.public_key()
index = multisig_pubkey_index(multisig, pubkey)
if index is None:
raise wire.ProcessError("Public key not found")
if coin.address_type_p2sh is None:
raise wire.ProcessError("Multisig not enabled on this coin")

Loading…
Cancel
Save