From a798a07220de3daa7b79b4b5b03c237841397322 Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Tue, 15 Nov 2016 11:52:41 +0100 Subject: [PATCH] signtx: confirm output before hashing --- src/apps/common/signtx.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/apps/common/signtx.py b/src/apps/common/signtx.py index 1b3ff67f..d97a95e7 100644 --- a/src/apps/common/signtx.py +++ b/src/apps/common/signtx.py @@ -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: