1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-18 13:38:12 +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]: if self.segwit[i]:
await self.sign_segwit_input(i) await self.sign_segwit_input(i)
elif any_segwit: elif any_segwit:
# TODO what if a non-segwit input follows after a segwit input? # add empty witness for non-segwit inputs
self.tx_ser.serialized_tx += bytearray( self.tx_ser.serialized_tx.append(0)
1
) # empty witness for non-segwit inputs
self.tx_ser.signature_index = None
self.tx_ser.signature = None
self.tx_req.serialized = self.tx_ser self.tx_req.serialized = self.tx_ser
async def step7_finish(self) -> None: async def step7_finish(self) -> None: