From 0ac2a86253349a2d05874d258a179b5f73697dc5 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 6 Nov 2026 04:34:44 +0100 Subject: worker sends off the pass --- src/state/peer.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/state/peer.rs') diff --git a/src/state/peer.rs b/src/state/peer.rs index 857c29d..2f027ba 100644 --- a/src/state/peer.rs +++ b/src/state/peer.rs @@ -104,6 +104,9 @@ pub(crate) struct PeerState { pub(crate) last_seen: Option, /// Our last keepalive to it (a PING or a STATUS). pub(crate) last_keepalive_at: Option, + /// The peer worker's sends to it (a keepalive, a HELLO again) are on their way, off + /// the worker's pass (`swarm::peer::run_peer_worker`): none more until they are. + pub(crate) worker_sending: bool, /// Its last keepalive to us (a PING or a STATUS): after it, the next is ours. pub(crate) keepalive_received_at: Option, /// The last STATUS between us, either way (`status_refresh`). @@ -288,6 +291,7 @@ impl PeerState { added_at: Instant::now(), last_seen: None, last_keepalive_at: None, + worker_sending: false, keepalive_received_at: None, last_status_at: None, awaiting_answer: None, @@ -640,7 +644,8 @@ impl PeerState { ) -> Option { let dormancy = (ready && neighbour && !self.liveness.is_dormant()) .then(|| self.last_seen.unwrap_or(self.added_at) + timing.dormant_after); - let keepalive = if neighbour { + // Not while the worker's sends to it are on their way: after them (they wake it). + let keepalive = if neighbour && !self.worker_sending { self.keepalive_due_at(timing) } else { None -- cgit v1.3.1