diff options
| author | tv <tv@krebsco.de> | 2026-10-31 06:51:17 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-31 06:51:17 +0100 |
| commit | 7feea90e195cec3e99d294fa518f9a9e4ebeebcb (patch) | |
| tree | c2f8e6cc1ca245a9a0f1c29711e4abbcb75aff7b /src/transport/identity.rs | |
| parent | bef59234ea3e219d80373d760601ba40f4789a47 (diff) | |
calculate peer clock drift
Diffstat (limited to 'src/transport/identity.rs')
| -rw-r--r-- | src/transport/identity.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/transport/identity.rs b/src/transport/identity.rs index eb7bb93..a748505 100644 --- a/src/transport/identity.rs +++ b/src/transport/identity.rs @@ -603,6 +603,15 @@ impl Transport for IdentityTransport { self.shared.paths.rtt(&address) } + /// The narrowest of its proven paths'. + fn clock_offset(&self, peer: &str) -> Option<crate::transport::paths::ClockOffset> { + self.shared + .proven_at(peer, false) + .iter() + .filter_map(|address| self.shared.paths.clock_offset(address)) + .min_by_key(|offset| offset.within_ms) + } + /// The identity layer's, and each transport's. fn stats(&self) -> TransportStats { let mut stats = self.shared.paths.stats(); |
