Skip to content

Commit 4b33b50

Browse files
rustyrussellniftynei
authored andcommitted
gossipd: ask a peer for *every* channel it knows on startup.
Asking for the last few blocks was logical, but my node is missing most gossip in practice. For the moment, simply ask a peer for every channel it knows, once we're started up. Signed-off-by: Rusty Russell <[email protected]>
1 parent 79df507 commit 4b33b50

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

gossipd/seeker.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -755,8 +755,6 @@ static void probe_many_random_scids(struct seeker *seeker)
755755

756756
static void check_firstpeer(struct seeker *seeker)
757757
{
758-
struct chan *c;
759-
u64 index;
760758
struct peer *peer = seeker->random_peer_softref, *p;
761759

762760
/* It might have died, pick another. */
@@ -787,14 +785,11 @@ static void check_firstpeer(struct seeker *seeker)
787785
normal_gossip_start(seeker, p);
788786
}
789787

790-
/* We always look up 6 prior to last we have */
791-
c = uintmap_last(&seeker->daemon->rstate->chanmap, &index);
792-
if (c && short_channel_id_blocknum(&c->scid) > 6) {
793-
seeker->scid_probe_start = short_channel_id_blocknum(&c->scid) - 6;
794-
} else {
795-
seeker->scid_probe_start = 0;
796-
}
788+
/* Ask a random peer for all channels, in case we're missing */
789+
seeker->scid_probe_start = chainparams->when_lightning_became_cool;
797790
seeker->scid_probe_end = seeker->daemon->current_blockheight;
791+
if (seeker->scid_probe_start > seeker->scid_probe_end)
792+
seeker->scid_probe_start = 0;
798793
peer_gossip_probe_scids(seeker);
799794
}
800795

0 commit comments

Comments
 (0)