From 0039ffe04d290935936d33e681c2a0f2575c4264 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 25 Oct 2026 23:50:29 +0100 Subject: refresh peers after stall --- src/swarm/source.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/swarm/source.rs') 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 }); } } -- cgit v1.3.1