From f81a7ff792f55399e83709bd11f4ad2af6777d85 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 20 Apr 2022 07:24:02 +0930 Subject: [PATCH] gossipd: fix daily node_announcement regeneration. We have an explicit filter against redundant node_announcement updates; we only allow 1 a week. This means that our change to force a reannouncement every 24 hours did not work! Allow once a day, instead. Signed-off-by: Rusty Russell --- gossipd/routing.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gossipd/routing.c b/gossipd/routing.c index a81e400f9..cfed0e0eb 100644 --- a/gossipd/routing.c +++ b/gossipd/routing.c @@ -1614,6 +1614,7 @@ bool routing_add_node_announcement(struct routing_state *rstate, if (node->bcast.index) { bool only_tlv_diff; + u32 redundant_time; if (index != 0) { status_broken("gossip_store node_announcement %u replaces %u!", @@ -1627,8 +1628,9 @@ bool routing_add_node_announcement(struct routing_state *rstate, return index == 0; } - /* Allow redundant updates once every 7 days */ - if (timestamp < node->bcast.timestamp + GOSSIP_PRUNE_INTERVAL(rstate->dev_fast_gossip_prune) / 2 + /* Allow redundant updates once a day (faster in dev-fast-gossip-prune mode) */ + redundant_time = GOSSIP_PRUNE_INTERVAL(rstate->dev_fast_gossip_prune) / 14; + if (timestamp < node->bcast.timestamp + redundant_time && !nannounce_different(rstate->gs, node, msg, &only_tlv_diff)) { SUPERVERBOSE(