From e13d027567f781c9729a518913b21ec4ee273039 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 28 Oct 2026 11:57:54 +0100 Subject: peers from member list start as unknown --- src/state/host.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/state/host.rs') 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, -- cgit v1.3.1