From 2d53123f93fe35993f317b00be71c7c8410e635b Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 25 Oct 2026 22:04:15 +0100 Subject: run peer worker when becoming ready --- src/swarm/peer.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/swarm') diff --git a/src/swarm/peer.rs b/src/swarm/peer.rs index fc37ec2..7385ae2 100644 --- a/src/swarm/peer.rs +++ b/src/swarm/peer.rs @@ -443,12 +443,20 @@ pub(crate) async fn run_peer_worker(state: AppState) { info!("Starting peer maintenance worker"); let mut last_forget_check: Option = None; + let mut was_ready = false; loop { tick.tick().await; // While joining, keep handshakes fast; dormancy would slow probes to minutes. let ready = state.is_ready().await; + if ready && !was_ready { + // Just became ready: register in the member list (and do the other periodic + // checks) now rather than at the next check. Until it is registered, other + // members don't count this node as a neighbour. + last_forget_check = None; + } + was_ready = ready; let peers: Vec<(String, Arc>)> = state .peer_states -- cgit v1.3.1