Browse Source

seeker: don't try to fill peers when they connect.

On testing, I found a node which would hang up every time we asked it
for query_short_channel_ids (despite it offering features 0x81, meaning
it should handle this message).

Then it would reconnect, and we'd choose it again as our
PROBING_NANNOUNCES peer!

Instead, leave finding another peer to the once-a-minute
seeker_check() function.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
travis-debug
Rusty Russell 5 years ago
committed by neil saitug
parent
commit
89d97b330e
  1. 18
      gossipd/seeker.c

18
gossipd/seeker.c

@ -935,8 +935,6 @@ static void seeker_check(struct seeker *seeker)
/* We get this when we have a new peer. */ /* We get this when we have a new peer. */
void seeker_setup_peer_gossip(struct seeker *seeker, struct peer *peer) void seeker_setup_peer_gossip(struct seeker *seeker, struct peer *peer)
{ {
bool have_probing_peer = seeker->random_peer_softref != NULL;
/* Can't do anything useful with these peers. */ /* Can't do anything useful with these peers. */
if (!peer->gossip_queries_feature) if (!peer->gossip_queries_feature)
return; return;
@ -948,31 +946,21 @@ void seeker_setup_peer_gossip(struct seeker *seeker, struct peer *peer)
switch (seeker->state) { switch (seeker->state) {
case STARTING_UP: case STARTING_UP:
if (!have_probing_peer) if (seeker->random_peer_softref == NULL)
peer_gossip_startup(seeker, peer); peer_gossip_startup(seeker, peer);
/* Waiting for seeker_check to release us */ /* Waiting for seeker_check to release us */
return; return;
/* In these states, we set up peers to stream gossip normally */ /* In these states, we set up peers to stream gossip normally */
case PROBING_SCIDS: case PROBING_SCIDS:
if (!have_probing_peer)
peer_gossip_probe_scids(seeker);
goto start_them_gossiping;
case PROBING_NANNOUNCES: case PROBING_NANNOUNCES:
if (!have_probing_peer)
peer_gossip_probe_nannounces(seeker);
goto start_them_gossiping;
case NORMAL: case NORMAL:
case ASKING_FOR_UNKNOWN_SCIDS: case ASKING_FOR_UNKNOWN_SCIDS:
case ASKING_FOR_STALE_SCIDS: case ASKING_FOR_STALE_SCIDS:
goto start_them_gossiping; normal_gossip_start(seeker, peer);
return;
} }
abort(); abort();
start_them_gossiping:
normal_gossip_start(seeker, peer);
} }
bool remove_unknown_scid(struct seeker *seeker, bool remove_unknown_scid(struct seeker *seeker,

Loading…
Cancel
Save