From c2a6de30426b0bd4e71d6511f02db135d9cc2f3d Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 27 Apr 2021 14:12:10 +0930 Subject: [PATCH] channeld: fix test code for tx fee calculation (inside `#ifdef PRINT_ACTUAL_FEE`) Has an out-by-one error, but only used for test-vector generation. Signed-off-by: Rusty Russell --- channeld/commit_tx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/channeld/commit_tx.c b/channeld/commit_tx.c index d3483d6dd..cb70c09e0 100644 --- a/channeld/commit_tx.c +++ b/channeld/commit_tx.c @@ -168,9 +168,9 @@ struct bitcoin_tx *commit_tx(const tal_t *ctx, option_anchor_outputs, side)) ok &= amount_sat_add(&out, out, amount_msat_to_sat_round_down(htlcs[i]->amount)); } - if (amount_msat_greater_sat(self_pay, dust_limit)) + if (amount_msat_greater_eq_sat(self_pay, dust_limit)) ok &= amount_sat_add(&out, out, amount_msat_to_sat_round_down(self_pay)); - if (amount_msat_greater_sat(other_pay, dust_limit)) + if (amount_msat_greater_eq_sat(other_pay, dust_limit)) ok &= amount_sat_add(&out, out, amount_msat_to_sat_round_down(other_pay)); assert(ok); SUPERVERBOSE("# actual commitment transaction fee = %"PRIu64"\n",