diff options
Diffstat (limited to 'src/swarm/working_links.rs')
| -rw-r--r-- | src/swarm/working_links.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/swarm/working_links.rs b/src/swarm/working_links.rs index ca3a22b..9ccfaa1 100644 --- a/src/swarm/working_links.rs +++ b/src/swarm/working_links.rs @@ -141,6 +141,13 @@ pub(crate) fn settled(state: &AppState) -> (u64, bool) { (pending.checks, pending.since.is_empty()) } +/// Whether no link's change waits to be recorded, and no member is being asked about +/// one: nothing of `check` waits on time. +pub(crate) fn quiet(state: &AppState) -> bool { + let pending = state.working_links.lock_or_recover(); + pending.since.is_empty() && pending.probes.is_empty() +} + /// With the peer worker's periodic pass (every 5 s): whom we reach now, against the /// member list's graph and our record; a difference that held for long enough goes into /// the record. |
