From 27e5ddc7b766cc8dad607d01c9c1de1fb22ebf45 Mon Sep 17 00:00:00 2001 From: Alex Myers Date: Tue, 12 Jul 2022 17:31:43 -0500 Subject: [PATCH] gossipd: fix of gossip v10 channel removal handling Node announcement indices should be reinitialized after removing the referenced announcement. Debugging output also corrected. Changelog-None --- gossipd/routing.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gossipd/routing.c b/gossipd/routing.c index b79b3e3d8..6bdc0020d 100644 --- a/gossipd/routing.c +++ b/gossipd/routing.c @@ -501,6 +501,8 @@ static void remove_chan_from_node(struct routing_state *rstate, gossip_store_delete(rstate->gs, &node->bcast, WIRE_NODE_ANNOUNCEMENT); + node->rgraph.index = node->bcast.index = 0; + node->rgraph.timestamp = node->bcast.timestamp = 0; } else if (node_announce_predates_channels(node)) { /* node announcement predates all channel announcements? * Move to end (we could, in theory, move to just past next @@ -1377,7 +1379,7 @@ bool routing_add_channel_update(struct routing_state *rstate, } else if (hc->bcast.index != hc->rgraph.index){ status_broken("gossip_store rate-limited " "channel_update %u replaces %u!", - index, hc->bcast.index); + index, hc->rgraph.index); return false; } } @@ -1730,7 +1732,7 @@ bool routing_add_node_announcement(struct routing_state *rstate, } else if (node->bcast.index != node->rgraph.index){ status_broken("gossip_store rate-limited " "node_announcement %u replaces %u!", - index, node->bcast.index); + index, node->rgraph.index); return false; } }