summaryrefslogtreecommitdiffstats
path: root/src/state/host.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/host.rs')
-rw-r--r--src/state/host.rs6
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,