mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-13 19:18:56 +00:00
fix(core): In apps.bitcoin ensure that get_address() fails for multisig if user's public key is not included.
This commit is contained in:
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…
Reference in New Issue
Block a user