mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 14:58:09 +00:00
signing/multisig: fix missing pubkey, remove dead code
This commit is contained in:
parent
a46934459a
commit
6472b201f7
@ -66,7 +66,7 @@ def multisig_pubkey_index(multisig: MultisigRedeemScriptType, pubkey: bytes) ->
|
||||
for i, hd in enumerate(multisig.pubkeys):
|
||||
if multisig_get_pubkey(hd) == pubkey:
|
||||
return i
|
||||
return -1
|
||||
return None
|
||||
|
||||
|
||||
def multisig_get_pubkey(hd: HDNodePathType) -> bytes:
|
||||
@ -85,10 +85,3 @@ def multisig_get_pubkey(hd: HDNodePathType) -> bytes:
|
||||
|
||||
def multisig_get_pubkeys(multisig: MultisigRedeemScriptType):
|
||||
return [multisig_get_pubkey(hd) for hd in multisig.pubkeys]
|
||||
|
||||
|
||||
def check_address_n_against_pubkeys(multisig: MultisigRedeemScriptType, address_n) -> bool:
|
||||
for p in multisig.pubkeys:
|
||||
if p.address_n == address_n:
|
||||
return True
|
||||
return False
|
||||
|
@ -281,7 +281,7 @@ async def sign_tx(tx: SignTx, root):
|
||||
# if multisig, check if singing with a key that is included in multisig
|
||||
if txi_sign.multisig:
|
||||
pubkey_idx = multisig_pubkey_index(txi_sign.multisig, key_sign_pub)
|
||||
if pubkey_idx < 0:
|
||||
if pubkey_idx is None:
|
||||
raise SigningError(FailureType.DataError,
|
||||
'Pubkey not found in multisig script')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user