diff --git a/src/apps/wallet/sign_tx/scripts.py b/src/apps/wallet/sign_tx/scripts.py index 310435b373..7a4bb03cc7 100644 --- a/src/apps/wallet/sign_tx/scripts.py +++ b/src/apps/wallet/sign_tx/scripts.py @@ -137,6 +137,7 @@ def get_p2wpkh_witness(signature: bytes, pubkey: bytes, sighash: int): return w +# p2wsh is a generic mechanism but is currently used for multisig only def get_p2wsh_witness(multisig: MultisigRedeemScriptType, signature: bytes, signature_index: int, sighash: int): signatures = multisig.signatures # other signatures diff --git a/src/apps/wallet/sign_tx/signing.py b/src/apps/wallet/sign_tx/signing.py index 8e27855aed..739c749ba6 100644 --- a/src/apps/wallet/sign_tx/signing.py +++ b/src/apps/wallet/sign_tx/signing.py @@ -347,7 +347,7 @@ async def sign_tx(tx: SignTx, root): signature = ecdsa_sign(key_sign, bip143_hash) if txi.multisig: - # place of our signature based on the pubkey + # find out place of our signature based on the pubkey signature_index = multisig_pubkey_index(txi_sign.multisig, key_sign_pub) witness = get_p2wsh_witness(txi.multisig, signature, signature_index, get_hash_type(coin)) else: