lightningd: don't spam with RBF messages if fee hasn't changed.

Reported-by: @19710405 on GitHub
Fixes: #6283
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-06-26 08:31:21 +09:30
parent cba310b983
commit 47fd31e8b4

View File

@@ -845,12 +845,17 @@ static bool consider_onchain_rebroadcast(struct channel *channel,
bitcoin_txid(newtx, &newtxid); bitcoin_txid(newtx, &newtxid);
bitcoin_txid(*tx, &oldtxid); bitcoin_txid(*tx, &oldtxid);
log_info(channel->log,
"RBF onchain txid %s (fee %s) with txid %s (fee %s)", /* Don't spam the logs! */
type_to_string(tmpctx, struct bitcoin_txid, &oldtxid), log_(channel->log,
fmt_amount_sat(tmpctx, info->fee), amount_sat_less_eq(newfee, info->fee) ? LOG_DBG : LOG_INFORM,
type_to_string(tmpctx, struct bitcoin_txid, &newtxid), NULL, false,
fmt_amount_sat(tmpctx, newfee)); "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, log_debug(channel->log,
"RBF %s->%s", "RBF %s->%s",
type_to_string(tmpctx, struct bitcoin_tx, *tx), type_to_string(tmpctx, struct bitcoin_tx, *tx),