From ad0bcf6bcc0ab2267c9890e6abea5a1159afe289 Mon Sep 17 00:00:00 2001 From: Alex Myers Date: Mon, 28 Oct 2024 13:38:13 -0500 Subject: [PATCH] gossipd: seeker: rotate worst gossiper every 30 minutes This will allow all gossipers to be rotated in ~5 hours similar to how it operated with half as many gossip streaming peers. --- gossipd/seeker.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gossipd/seeker.c b/gossipd/seeker.c index 1b48d2edccfd..6eeeaa8e71b1 100644 --- a/gossipd/seeker.c +++ b/gossipd/seeker.c @@ -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++) {