From f57d1f460eee8252ca8a7a3ceda09f34cc077b65 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sun, 11 Feb 2024 21:07:41 +1030 Subject: [PATCH] gossipd: don't consider dying channels when seeking preceeding channel_announcements. We make sure a node_announcement is preceeded by at least one channel_announcement, but dying ones don't count (as they are not broadcast!). Signed-off-by: Rusty Russell --- gossipd/gossmap_manage.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gossipd/gossmap_manage.c b/gossipd/gossmap_manage.c index 665e90839..c5a500266 100644 --- a/gossipd/gossmap_manage.c +++ b/gossipd/gossmap_manage.c @@ -216,8 +216,12 @@ static bool any_cannounce_preceeds_offset(struct gossmap *gossmap, if (chan == exclude_chan) continue; - if (chan->cann_off < offset) - return true; + if (chan->cann_off > offset) + continue; + /* Dying channels don't help! */ + if (gossmap_chan_is_dying(gossmap, chan)) + continue; + return true; } return false; }