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

bip143: all inputs (not only segwit ones) are added to bip143

This commit is contained in:
Tomas Susanka 2017-11-20 17:18:55 +01:00
parent 26265ca511
commit 4fdc389a22

View File

@ -64,6 +64,8 @@ async def check_tx_fee(tx: SignTx, root):
txi = await request_tx_input(tx_req, i) txi = await request_tx_input(tx_req, i)
wallet_path = input_extract_wallet_path(txi, wallet_path) wallet_path = input_extract_wallet_path(txi, wallet_path)
write_tx_input_check(h_first, txi) write_tx_input_check(h_first, txi)
bip143.add_prevouts(txi)
bip143.add_sequence(txi)
if (txi.script_type == InputScriptType.SPENDWITNESS or if (txi.script_type == InputScriptType.SPENDWITNESS or
txi.script_type == InputScriptType.SPENDP2SHWITNESS): txi.script_type == InputScriptType.SPENDP2SHWITNESS):
if not coin.segwit: if not coin.segwit:
@ -73,8 +75,6 @@ async def check_tx_fee(tx: SignTx, root):
raise SigningError(FailureType.DataError, raise SigningError(FailureType.DataError,
'Segwit input without amount') 'Segwit input without amount')
segwit[i] = True segwit[i] = True
bip143.add_prevouts(txi)
bip143.add_sequence(txi)
total_in += txi.amount total_in += txi.amount
elif txi.script_type == InputScriptType.SPENDADDRESS: elif txi.script_type == InputScriptType.SPENDADDRESS:
segwit[i] = False segwit[i] = False