aboutsummaryrefslogtreecommitdiffstats
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
commit19e12319931187f210ba11247bd92959e6ddfe48 (patch)
treedd9749de1ac5a91abef40a806a3cec1d84f2692c /src/swarm/source.rs
parent6f5edc4fdab82ca09b0f77be6d2ffd1616132521 (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 });
}
}