mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 22:45:27 +01:00
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>
This commit is contained in:
parent
596ed6a83b
commit
89d97b330e
1 changed files with 3 additions and 15 deletions
|
@ -935,8 +935,6 @@ static void seeker_check(struct seeker *seeker)
|
|||
/* We get this when we have a new 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. */
|
||||
if (!peer->gossip_queries_feature)
|
||||
return;
|
||||
|
@ -948,31 +946,21 @@ void seeker_setup_peer_gossip(struct seeker *seeker, struct peer *peer)
|
|||
|
||||
switch (seeker->state) {
|
||||
case STARTING_UP:
|
||||
if (!have_probing_peer)
|
||||
if (seeker->random_peer_softref == NULL)
|
||||
peer_gossip_startup(seeker, peer);
|
||||
/* Waiting for seeker_check to release us */
|
||||
return;
|
||||
|
||||
/* In these states, we set up peers to stream gossip normally */
|
||||
case PROBING_SCIDS:
|
||||
if (!have_probing_peer)
|
||||
peer_gossip_probe_scids(seeker);
|
||||
goto start_them_gossiping;
|
||||
|
||||
case PROBING_NANNOUNCES:
|
||||
if (!have_probing_peer)
|
||||
peer_gossip_probe_nannounces(seeker);
|
||||
goto start_them_gossiping;
|
||||
|
||||
case NORMAL:
|
||||
case ASKING_FOR_UNKNOWN_SCIDS:
|
||||
case ASKING_FOR_STALE_SCIDS:
|
||||
goto start_them_gossiping;
|
||||
normal_gossip_start(seeker, peer);
|
||||
return;
|
||||
}
|
||||
abort();
|
||||
|
||||
start_them_gossiping:
|
||||
normal_gossip_start(seeker, peer);
|
||||
}
|
||||
|
||||
bool remove_unknown_scid(struct seeker *seeker,
|
||||
|
|
Loading…
Add table
Reference in a new issue