gossipd: make sure we correctly move node announcement when *no* channel preceeds it in the gossip store.

We had the test backwards, so we moved it *all the time*.  This bloats our gossip store, as well as
not moving it in the case where we need to.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: gossipd: we would occasionally not show a node announcement in listnodes().
This commit is contained in:
Rusty Russell
2025-12-08 16:11:46 +10:30
committed by madelinevibes
parent d1857fff91
commit f0e9547661
2 changed files with 1 additions and 2 deletions

View File

@@ -300,7 +300,7 @@ static void remove_channel(struct gossmap_manage *gm,
/* Maybe this was the last channel_announcement which preceeded node_announcement? */
if (chan->cann_off < node->nann_off
&& any_cannounce_preceeds_offset(gossmap, node, chan, node->nann_off)) {
&& !any_cannounce_preceeds_offset(gossmap, node, chan, node->nann_off)) {
const u8 *nannounce;
u32 timestamp;