1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-18 05:28:40 +00:00

core/sign_tx: Fix segwit/non-segwit input interleaving bug.

This commit is contained in:
Andrew Kozlik 2020-04-09 14:35:56 +02:00 committed by Andrew Kozlik
parent 514f2ac649
commit f1801764a1

View File

@ -181,12 +181,8 @@ class Bitcoin:
if self.segwit[i]:
await self.sign_segwit_input(i)
elif any_segwit:
# TODO what if a non-segwit input follows after a segwit input?
self.tx_ser.serialized_tx += bytearray(
1
) # empty witness for non-segwit inputs
self.tx_ser.signature_index = None
self.tx_ser.signature = None
# add empty witness for non-segwit inputs
self.tx_ser.serialized_tx.append(0)
self.tx_req.serialized = self.tx_ser
async def step7_finish(self) -> None: