diff --git a/gossipd/gossip_store.c b/gossipd/gossip_store.c index 968c138f6a23..6db129f58595 100644 --- a/gossipd/gossip_store.c +++ b/gossipd/gossip_store.c @@ -884,7 +884,7 @@ u32 gossip_store_load(struct routing_state *rstate, struct gossip_store *gs) case WIRE_NODE_ANNOUNCEMENT: /* In early v23.02 rcs we had zombie node announcements, * so throw them away here. */ - if (be16_to_cpu(hdr.flags) & GOSSIP_STORE_ZOMBIE_BIT) { + if (zombie) { status_unusual("gossip_store: removing zombie" " node_announcement from v23.02 rcs"); break; diff --git a/gossipd/routing.c b/gossipd/routing.c index 11e0c5cd7fee..ef7693f1ac3a 100644 --- a/gossipd/routing.c +++ b/gossipd/routing.c @@ -381,6 +381,13 @@ static struct node *new_node(struct routing_state *rstate, return n; } +static bool is_chan_zombie(struct chan *chan) +{ + if (chan->half[0].zombie || chan->half[1].zombie) + return true; + return false; +} + /* We've received a channel_announce for a channel attached to this node: * otherwise it's in the map only because it's a peer, or us. */ static bool node_has_public_channels(struct node *node) @@ -389,19 +396,12 @@ static bool node_has_public_channels(struct node *node) struct chan *c; for (c = first_chan(node, &i); c; c = next_chan(node, &i)) { - if (is_chan_public(c)) + if (is_chan_public(c) && !is_chan_zombie(c)) return true; } return false; } -static bool is_chan_zombie(struct chan *chan) -{ - if (chan->half[0].zombie || chan->half[1].zombie) - return true; - return false; -} - static bool is_node_zombie(struct node* node) { struct chan_map_iter i; @@ -1907,7 +1907,7 @@ bool routing_add_node_announcement(struct routing_state *rstate, = gossip_store_add(rstate->gs, msg, timestamp, node_id_eq(&node_id, &rstate->local_id), - is_node_zombie(node), spam, NULL); + false, spam, NULL); if (node->bcast.timestamp > rstate->last_timestamp && node->bcast.timestamp < time_now().ts.tv_sec) rstate->last_timestamp = node->bcast.timestamp;