diff options
| author | tv <tv@krebsco.de> | 2026-10-28 11:57:54 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-28 11:57:54 +0100 |
| commit | e13d027567f781c9729a518913b21ec4ee273039 (patch) | |
| tree | ada25e93f6164e0ce80282616937f19fc8f1aec0 /src/state/host.rs | |
| parent | 8a4e5bab13069a298fa1d8c756e1a6c0bd719dfb (diff) | |
peers from member list start as unknown
Diffstat (limited to 'src/state/host.rs')
| -rw-r--r-- | src/state/host.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/state/host.rs b/src/state/host.rs index 6eab803..b55239d 100644 --- a/src/state/host.rs +++ b/src/state/host.rs @@ -11,7 +11,7 @@ use tokio::sync::broadcast; use tokio::time::Instant; use tracing::debug; -use super::{AppState, HelloState, Liveness, NodeLifecycle, StaleView, Standing}; +use super::{AppState, HelloState, NodeLifecycle, StaleView, Standing}; use crate::document::replica::Epoch; use crate::locks::MutexExt; use crate::remake::{Host, PeerSummary, RemakeState}; @@ -42,7 +42,7 @@ impl AppState { let mut peer_state = peer_state_mutex.lock().await; // What it said about syncing with us was about our old epoch. peer_state.syncs_with_us = None; - let gets_our_opening = peer_state.liveness == Liveness::Active + let gets_our_opening = !peer_state.liveness.is_dormant() && matches!(peer_state.standing, Standing::Member { .. }) && peer_state.epoch == Some(local) && peer_state.reports_ready == Some(true); @@ -131,7 +131,7 @@ impl Host for AppState { let peer = peer.lock().await; summaries.push(PeerSummary { id, - active: peer.liveness == Liveness::Active, + active: !peer.liveness.is_dormant(), member: matches!(peer.standing, Standing::Member { .. }) && peer.hello_state == HelloState::Established, ready: peer.reports_ready, |
