signtx: confirm output before hashing

This commit is contained in:
Jan Pochyla 2016-11-15 11:52:41 +01:00
parent 90d9687678
commit a798a07220
1 changed files with 4 additions and 4 deletions

View File

@ -130,15 +130,15 @@ async def sign_tx(tx: SignTx, root):
raise SigningError(FailureType.Other,
'Only one change output is valid')
change_out = txo.amount
else:
if not await confirm_output(txo, coin):
raise SigningError(FailureType.ActionCancelled,
'Output cancelled')
txo_bin.amount = txo.amount
txo_bin.script_pubkey = output_derive_script(txo, coin, root)
write_tx_output(h_first, txo_bin)
total_out += txo_bin.amount
if not output_is_change(txo) and not await confirm_output(txo, coin):
raise SigningError(FailureType.ActionCancelled,
'Output cancelled')
fee = total_in - total_out
if fee < 0: