From 47fd31e8b40f839b4f02c82ac79100a75393c7cc Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 26 Jun 2023 08:31:21 +0930 Subject: [PATCH] lightningd: don't spam with RBF messages if fee hasn't changed. Reported-by: @19710405 on GitHub Fixes: #6283 Signed-off-by: Rusty Russell --- lightningd/onchain_control.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lightningd/onchain_control.c b/lightningd/onchain_control.c index 37c0b3dd4..266a911fe 100644 --- a/lightningd/onchain_control.c +++ b/lightningd/onchain_control.c @@ -845,12 +845,17 @@ static bool consider_onchain_rebroadcast(struct channel *channel, bitcoin_txid(newtx, &newtxid); bitcoin_txid(*tx, &oldtxid); - log_info(channel->log, - "RBF onchain txid %s (fee %s) with txid %s (fee %s)", - type_to_string(tmpctx, struct bitcoin_txid, &oldtxid), - fmt_amount_sat(tmpctx, info->fee), - type_to_string(tmpctx, struct bitcoin_txid, &newtxid), - fmt_amount_sat(tmpctx, newfee)); + + /* Don't spam the logs! */ + log_(channel->log, + amount_sat_less_eq(newfee, info->fee) ? LOG_DBG : LOG_INFORM, + NULL, false, + "RBF onchain txid %s (fee %s) with txid %s (fee %s)", + type_to_string(tmpctx, struct bitcoin_txid, &oldtxid), + fmt_amount_sat(tmpctx, info->fee), + type_to_string(tmpctx, struct bitcoin_txid, &newtxid), + fmt_amount_sat(tmpctx, newfee)); + log_debug(channel->log, "RBF %s->%s", type_to_string(tmpctx, struct bitcoin_tx, *tx),