diff --git a/gossipd/gossip.c b/gossipd/gossip.c index dc19e46c6..d5e9e41b1 100644 --- a/gossipd/gossip.c +++ b/gossipd/gossip.c @@ -1241,7 +1241,7 @@ static void append_half_channel(struct gossip_getchannels_entry **entries, e->satoshis = chan->satoshis; e->active = c->active; e->flags = c->flags; - e->public = (c->channel_update_msgidx != 0); + e->public = chan->public && (c->channel_update_msgidx != 0); e->short_channel_id = chan->scid; e->last_update_timestamp = c->channel_update_msgidx ? c->last_timestamp : -1; if (e->last_update_timestamp >= 0) { diff --git a/gossipd/routing.c b/gossipd/routing.c index d0d6032fc..d7930588e 100644 --- a/gossipd/routing.c +++ b/gossipd/routing.c @@ -1047,9 +1047,11 @@ u8 *handle_channel_update(struct routing_state *rstate, const u8 *update) if (!routing_add_channel_update(rstate, serialized)) status_failed(STATUS_FAIL_INTERNAL_ERROR, "Failed adding channel_update"); - /* Only store updates for public channels */ - if (chan->public) - gossip_store_add_channel_update(rstate->store, serialized); + + /* Store the channel_update for both public and non-public channels + * (non-public ones may just be the incoming direction). We'd have + * dropped invalid ones earlier. */ + gossip_store_add_channel_update(rstate->store, serialized); return NULL; }