From 8c3baa98cf53b8c9aeccb044aca8d9fb6c1f9009 Mon Sep 17 00:00:00 2001 From: Alex Myers Date: Fri, 3 Mar 2023 08:30:40 -0600 Subject: [PATCH] gossipd: remove zombie spam cupdate when resurrecting Changelog-Fixed: gossip_store is no longer corrupted when resurrecting channels --- gossipd/routing.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gossipd/routing.c b/gossipd/routing.c index ef7693f1a..3c7306d48 100644 --- a/gossipd/routing.c +++ b/gossipd/routing.c @@ -1546,10 +1546,15 @@ bool routing_add_channel_update(struct routing_state *rstate, /* FIXME: Handle spam case probably needs a helper f'n */ zombie_update[0] = gossip_store_get(tmpctx, rstate->gs, chan->half[!direction].bcast.index); - if (chan->half[!direction].bcast.index != chan->half[!direction].rgraph.index) + if (chan->half[!direction].bcast.index != chan->half[!direction].rgraph.index) { /* Don't forget the spam channel_update */ zombie_update[1] = gossip_store_get(tmpctx, rstate->gs, chan->half[!direction].rgraph.index); + gossip_store_delete(rstate->gs, &chan->half[!direction].rgraph, + is_chan_public(chan) + ? WIRE_CHANNEL_UPDATE + : WIRE_GOSSIP_STORE_PRIVATE_UPDATE); + } gossip_store_delete(rstate->gs, &chan->half[!direction].bcast, is_chan_public(chan) ? WIRE_CHANNEL_UPDATE