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 | 88160e8aa273090c55103e7a92eeae9a8bdac9ed (patch) | |
| tree | ad1d23dafbf808dfcf1a07552e4e9a47d41ffa74 /src/transport/identity.rs | |
| parent | 32c788b4d6245abebafb250b005a211fcbeac32c (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(); |
