diff options
| author | tv <tv@krebsco.de> | 2026-10-31 03:54:19 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-31 03:54:19 +0100 |
| commit | 4d09dcfcd7432ab303f848342d2f762b57b7c693 (patch) | |
| tree | d2396328d6ce3ac0e7a251aa582e7215d1e02bf5 /src/swarm | |
| parent | d4e6228a7d81b99ba3607eeb76c31f5b8c2f8d50 (diff) | |
unify closing logic
Diffstat (limited to 'src/swarm')
| -rw-r--r-- | src/swarm/peer/keepalive.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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(), } } |
