summaryrefslogtreecommitdiffstats
path: root/src/swarm/source.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-25 23:50:29 +0100
committertv <tv@krebsco.de>2026-10-25 23:50:29 +0100
commit0039ffe04d290935936d33e681c2a0f2575c4264 (patch)
tree1bfcaa189bcc5670b1959d766dfdc0e9f5816334 /src/swarm/source.rs
parenta232ec43702cdd23614737351120fd3b065e987d (diff)
refresh peers after stall
Diffstat (limited to 'src/swarm/source.rs')
-rw-r--r--src/swarm/source.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/swarm/source.rs b/src/swarm/source.rs
index 9eac445..b1701b3 100644
--- a/src/swarm/source.rs
+++ b/src/swarm/source.rs
@@ -23,7 +23,10 @@
//! `Timing::delivery_limit`, after which Mycelium has delivered or dropped anything it
//! sent before. It isn't chosen again for another `delivery_limit`, so another peer
//! takes over rather than the same one stalling again; if it is the only candidate,
-//! catching up waits that long before trying it again. Meanwhile, every minute without a sync message from it is logged as a
+//! catching up waits that long before trying it again. It also gets a fresh HELLO: a
+//! joining node learns of other peers only from HELLO_REPLYs, and the one it got from
+//! this peer may have listed none (a peer lists only its neighbours, which a new member
+//! isn't until its registration has spread). Meanwhile, every minute without a sync message from it is logged as a
//! warning.
use std::sync::atomic::Ordering;
@@ -203,6 +206,8 @@ pub(crate) fn reply_timed_out(state: &AppState, peer: &str) {
"Catch-up source doesn't answer our sync messages; catching up from another peer"
);
resync_everyone(state);
+ let (state, peer) = (state.clone(), peer.to_owned());
+ tokio::spawn(async move { crate::swarm::peer::rehandshake(&state, &peer).await });
}
}