summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/swarm/peer.rs8
1 files changed, 8 insertions, 0 deletions
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<Instant> = 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<Mutex<PeerState>>)> = state
.peer_states