Skip to content

Commit bd4269f

Browse files
author
Jamie C. Driver
committed
signing: don't show fees warning when fees and external spend amounts both zero
1 parent 918ea8b commit bd4269f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

main/process/sign_tx.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,15 @@ bool show_btc_fee_confirmation_activity(const struct wally_tx* tx, const output_
260260

261261
char warnbuf[128]; // sufficient
262262
const char* warning_msg = NULL;
263-
if (fees >= spend_amount && aggregate_inputs_scripts_flavour == SCRIPT_FLAVOUR_MIXED) {
263+
const bool warn_fees = fees && fees >= spend_amount;
264+
const bool warn_scripts = aggregate_inputs_scripts_flavour == SCRIPT_FLAVOUR_MIXED;
265+
if (warn_fees && warn_scripts) {
264266
const int retval = snprintf(warnbuf, sizeof(warnbuf), "%s %s", WARN_MSG_HIGH_FEES, WARN_MSG_MIXED_INPUTS);
265267
JADE_ASSERT(retval > 0 && retval < sizeof(warnbuf));
266268
warning_msg = warnbuf;
267-
} else if (aggregate_inputs_scripts_flavour == SCRIPT_FLAVOUR_MIXED) {
269+
} else if (warn_scripts) {
268270
warning_msg = WARN_MSG_MIXED_INPUTS;
269-
} else if (fees >= spend_amount) {
271+
} else if (warn_fees) {
270272
warning_msg = WARN_MSG_HIGH_FEES;
271273
}
272274

0 commit comments

Comments
 (0)