Skip to content

Commit

Permalink
gossipd: seeker: rotate worst gossiper every 30 minutes
Browse files Browse the repository at this point in the history
This will allow all gossipers to be rotated in ~5 hours similar to
how it operated with half as many gossip streaming peers.
  • Loading branch information
endothermicdev committed Nov 8, 2024
1 parent 68a4e54 commit ad0bcf6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gossipd/seeker.c
Original file line number Diff line number Diff line change
Expand Up @@ -923,12 +923,12 @@ static void maybe_rotate_gossipers(struct seeker *seeker)
goto set_gossiper;
}
}
/* Otherwise, rotate out a gossiper ~once per hour. */
if (pseudorand(60) != 0)
/* Otherwise, rotate out worst gossiper every 30 minutes on average. */
if (pseudorand(25) != 0)
return;
/* Don't evaluate gossip performance at a faster rate than
* new gossip is periodically emitted. */
if (seeker->new_gossiper_elapsed < 3)
if (seeker->new_gossiper_elapsed < 5)
return;
u32 lowest_count = UINT_MAX;
for (int j = 0; j < ARRAY_SIZE(seeker->gossiper); j++) {
Expand Down

0 comments on commit ad0bcf6

Please sign in to comment.