Skip to content

Commit

Permalink
gossipd: don't blanket disable channels on startup.
Browse files Browse the repository at this point in the history
This should only have an effect if someone queries, but in practice, peers actually
see the disabling of channels.

This is a workaround until we rework the code so gossipd doesn't generate these at all
any more.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Oct 30, 2023
1 parent 4f667e8 commit b6241cd
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions gossipd/gossipd.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,22 +814,6 @@ static void tell_master_local_cupdates(struct daemon *daemon)
}
}

/* Disables all channels connected to our node. */
static void gossip_disable_local_channels(struct daemon *daemon)
{
struct node *local_node = get_node(daemon->rstate, &daemon->id);
struct chan_map_iter i;
struct chan *c;

/* We don't have a local_node, so we don't have any channels yet
* either */
if (!local_node)
return;

for (c = first_chan(local_node, &i); c; c = next_chan(local_node, &i))
local_disable_chan(daemon, c, half_chan_idx(local_node, c));
}

struct peer *first_random_peer(struct daemon *daemon,
struct peer_node_id_map_iter *it)
{
Expand Down Expand Up @@ -897,9 +881,6 @@ static void gossip_init(struct daemon *daemon, const u8 *msg)
if (daemon->rstate->last_timestamp > timestamp)
daemon->rstate->last_timestamp = timestamp;

/* Now disable all local channels, they can't be connected yet. */
gossip_disable_local_channels(daemon);

/* If that announced channels, we can announce ourselves (options
* or addresses might have changed!) */
maybe_send_own_node_announce(daemon, true);
Expand Down

0 comments on commit b6241cd

Please sign in to comment.