aboutsummaryrefslogtreecommitdiffstats
path: root/src/state/mod.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-31 06:53:00 +0100
committertv <tv@krebsco.de>2026-10-31 06:53:00 +0100
commit1cb2ef3f00e695a414de87acfec090dfde749934 (patch)
treebfb67dd536741f6d1e1c09a79c114953dc5c3530 /src/state/mod.rs
parent88160e8aa273090c55103e7a92eeae9a8bdac9ed (diff)
add peer clock skew warning
Diffstat (limited to 'src/state/mod.rs')
-rw-r--r--src/state/mod.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/state/mod.rs b/src/state/mod.rs
index a2d5d74..cf50b2a 100644
--- a/src/state/mod.rs
+++ b/src/state/mod.rs
@@ -113,6 +113,11 @@ pub(crate) struct AppState {
pub(crate) alias: Option<String>,
/// Members alive within this window vote on remakes (`--electorate-window`).
pub(crate) electorate_window: Duration,
+ /// This node's clock is off when it differs from most of its peers' by more than
+ /// this (`--clock-skew-warn`, `swarm::skew`); 0: never.
+ pub(crate) clock_skew_warn: Duration,
+ /// When the log last said this node's clock is off, while it is (`swarm::skew`).
+ pub(crate) clock_skew_warned: Arc<std::sync::Mutex<Option<tokio::time::Instant>>>,
/// Chunked transfers served and fetched (`swarm::blob`).
pub(crate) blobs: Arc<crate::swarm::blob::Blobs>,
/// LINKS asked and answered, for a map of the swarm (`swarm::links`).