mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-18 05:28:40 +00:00
python/btc: improve missing signature detection
This commit is contained in:
parent
037bef3a38
commit
efcaf7bda6
@ -200,10 +200,7 @@ def sign_tx(
|
||||
res = client.call(signtx)
|
||||
|
||||
# Prepare structure for signatures
|
||||
signatures = [
|
||||
None if i.script_type != messages.InputScriptType.EXTERNAL else ""
|
||||
for i in inputs
|
||||
]
|
||||
signatures = [None] * len(inputs)
|
||||
serialized_tx = b""
|
||||
|
||||
def copy_tx_meta(tx):
|
||||
@ -268,7 +265,8 @@ def sign_tx(
|
||||
if not isinstance(res, messages.TxRequest):
|
||||
raise exceptions.TrezorException("Unexpected message")
|
||||
|
||||
if None in signatures:
|
||||
for i, sig in zip(inputs, signatures):
|
||||
if i.script_type != messages.InputScriptType.EXTERNAL and sig is None:
|
||||
raise exceptions.TrezorException("Some signatures are missing!")
|
||||
|
||||
return signatures, serialized_tx
|
||||
|
Loading…
Reference in New Issue
Block a user