Skip to content

Commit 8c3baa9

Browse files
gossipd: remove zombie spam cupdate when resurrecting
Changelog-Fixed: gossip_store is no longer corrupted when resurrecting channels
1 parent 538a8d5 commit 8c3baa9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

gossipd/routing.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1546,10 +1546,15 @@ bool routing_add_channel_update(struct routing_state *rstate,
15461546
/* FIXME: Handle spam case probably needs a helper f'n */
15471547
zombie_update[0] = gossip_store_get(tmpctx, rstate->gs,
15481548
chan->half[!direction].bcast.index);
1549-
if (chan->half[!direction].bcast.index != chan->half[!direction].rgraph.index)
1549+
if (chan->half[!direction].bcast.index != chan->half[!direction].rgraph.index) {
15501550
/* Don't forget the spam channel_update */
15511551
zombie_update[1] = gossip_store_get(tmpctx, rstate->gs,
15521552
chan->half[!direction].rgraph.index);
1553+
gossip_store_delete(rstate->gs, &chan->half[!direction].rgraph,
1554+
is_chan_public(chan)
1555+
? WIRE_CHANNEL_UPDATE
1556+
: WIRE_GOSSIP_STORE_PRIVATE_UPDATE);
1557+
}
15531558
gossip_store_delete(rstate->gs, &chan->half[!direction].bcast,
15541559
is_chan_public(chan)
15551560
? WIRE_CHANNEL_UPDATE

0 commit comments

Comments
 (0)