From 0bb3924836205a0364aaf0959c7cf387db004794 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 31 Oct 2026 03:54:19 +0100 Subject: unify closing logic --- src/swarm/peer/keepalive.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/swarm/peer') diff --git a/src/swarm/peer/keepalive.rs b/src/swarm/peer/keepalive.rs index 4b529f5..9037fdd 100644 --- a/src/swarm/peer/keepalive.rs +++ b/src/swarm/peer/keepalive.rs @@ -120,7 +120,7 @@ pub(crate) fn announce(state: &AppState) { /// catching up from us picks another source now, instead of once we go dormant. Bounded /// in time: our transport may be gone already. pub(crate) async fn farewell(state: &AppState) { - state.stopping.store(true, Ordering::Release); + state.closing.send_replace(true); info!("Saying farewell to our neighbours"); status_to_neighbours(state, Some(FAREWELL_TIMEOUT)).await; } @@ -145,9 +145,9 @@ pub(crate) async fn local_status(state: &AppState, peer: &str) -> transport::Sta heads, epoch, epoch_seq, - ready: state.is_ready().await && !state.stopping.load(Ordering::Acquire), + ready: state.is_ready().await && !state.is_closing(), syncs_with_you, - leaving: state.stopping.load(Ordering::Acquire), + leaving: state.is_closing(), } } -- cgit v1.3.1