1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 23:08:14 +00:00

core: better handling of TxRequest with mixed inputs

fixes #133
This commit is contained in:
matejcik 2019-05-07 16:31:40 +02:00
parent f7e0bb6183
commit bf067cc0c6

View File

@ -266,6 +266,8 @@ async def sign_tx(tx: SignTx, keychain: seed.Keychain):
writers.write_bytes(w_txi, get_tx_header(coin, tx, True))
writers.write_tx_input(w_txi, txi_sign)
tx_ser.serialized_tx = w_txi
tx_ser.signature_index = None
tx_ser.signature = None
tx_req.serialized = tx_ser
elif coin.force_bip143 or tx.overwintered:
@ -546,7 +548,7 @@ async def sign_tx(tx: SignTx, keychain: seed.Keychain):
tx_ser.signature_index = i
tx_ser.signature = signature
elif any_segwit:
tx_ser.serialized_tx = bytearray(1) # empty witness for non-segwit inputs
tx_ser.serialized_tx += bytearray(1) # empty witness for non-segwit inputs
tx_ser.signature_index = None
tx_ser.signature = None