From b197b713be93fe4b3d2a973612d143dd34f207e5 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 10 Jul 2023 15:23:19 +0930 Subject: [PATCH] bcli: don't feed CLN massive feerates. Stay classy, signet! Reported-by: Anthony Towns Signed-off-by: Rusty Russell --- plugins/bcli.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/bcli.c b/plugins/bcli.c index f48169761..bc681697c 100644 --- a/plugins/bcli.c +++ b/plugins/bcli.c @@ -683,6 +683,14 @@ static void json_add_feerate(struct json_stream *result, const char *fieldname, const struct estimatefees_stash *stash, uint64_t value) { + /* Anthony Towns reported signet had a 900kbtc fee block, and then + * CLN got upset scanning feerate. It expects a u32. */ + if (value > 0xFFFFFFFF) { + plugin_log(cmd->plugin, LOG_UNUSUAL, + "Feerate %"PRIu64" is ridiculous: trimming to 32 bites", + value); + value = 0xFFFFFFFF; + } /* 0 is special, it means "unknown" */ if (value && value < stash->perkb_floor) { plugin_log(cmd->plugin, LOG_DBG,