From 49f44d296cb4c1695ac35da07bc33e796acd67b8 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Sat, 13 May 2017 00:45:11 +0200 Subject: [PATCH] refactor signing_check_output --- firmware/signing.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/firmware/signing.c b/firmware/signing.c index 8871b01e4b..36c3f8d010 100644 --- a/firmware/signing.c +++ b/firmware/signing.c @@ -515,10 +515,11 @@ static bool signing_check_output(TxOutputType *txoutput) { && memcmp(multisig_fp, h, 32) == 0) { is_change = check_change_bip32_path(txoutput); } - } else if (txoutput->script_type == OutputScriptType_PAYTOADDRESS - || ((txoutput->script_type == OutputScriptType_PAYTOWITNESS - || txoutput->script_type == OutputScriptType_PAYTOP2SHWITNESS) - && txoutput->amount < segwit_to_spend)) { + } else if (txoutput->script_type == OutputScriptType_PAYTOADDRESS) { + is_change = check_change_bip32_path(txoutput); + } else if (txoutput->script_type == OutputScriptType_PAYTOWITNESS && txoutput->amount < segwit_to_spend) { + is_change = check_change_bip32_path(txoutput); + } else if (txoutput->script_type == OutputScriptType_PAYTOP2SHWITNESS && txoutput->amount < segwit_to_spend) { is_change = check_change_bip32_path(txoutput); } }