diff --git a/gossipd/routing.c b/gossipd/routing.c index 619dd921a..a0ab36a80 100644 --- a/gossipd/routing.c +++ b/gossipd/routing.c @@ -199,7 +199,7 @@ static bool remove_channel_from_array(struct chan ***chans, const struct chan *c static bool node_announce_predates_channels(const struct node *node) { for (size_t i = 0; i < tal_count(node->chans); i++) { - if (!is_chan_public(node->chans[i])) + if (!is_chan_announced(node->chans[i])) continue; if (node->chans[i]->channel_announcement_index diff --git a/gossipd/routing.h b/gossipd/routing.h index 1631498bb..f8552611e 100644 --- a/gossipd/routing.h +++ b/gossipd/routing.h @@ -61,11 +61,19 @@ struct chan { u64 satoshis; }; +/* A local channel can exist which isn't announcable. */ static inline bool is_chan_public(const struct chan *chan) { return chan->channel_announce != NULL; } +/* A channel is only announced once we have a channel_update to send + * with it. */ +static inline bool is_chan_announced(const struct chan *chan) +{ + return chan->channel_announcement_index != 0; +} + static inline bool is_halfchan_defined(const struct half_chan *hc) { return hc->channel_update != NULL;