Browse Source

gossip: HalfChans are public if we have an update and the Chan is

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 7 years ago
committed by Rusty Russell
parent
commit
9cfd09dc4a
  1. 2
      gossipd/gossip.c
  2. 8
      gossipd/routing.c

2
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) {

8
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;
}

Loading…
Cancel
Save