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/api/peers.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/api/peers.rs') diff --git a/src/api/peers.rs b/src/api/peers.rs index cea3644..eeb3fb2 100644 --- a/src/api/peers.rs +++ b/src/api/peers.rs @@ -23,6 +23,8 @@ use crate::transport::traffic::PeerTraffic; #[derive(Debug, Serialize)] #[serde(rename_all = "lowercase")] pub(crate) enum PeerLivenessStatus { + /// Nothing heard from it since this node started. + Unknown, Active, Dormant, } @@ -134,6 +136,7 @@ pub(crate) async fn list_peers( let ps = peer_state_mutex.lock().await; let (status, dormant_for_secs) = match ps.liveness { + Liveness::Unknown => (PeerLivenessStatus::Unknown, None), Liveness::Active => (PeerLivenessStatus::Active, None), Liveness::Dormant { since } => ( PeerLivenessStatus::Dormant, -- cgit v1.3.1