From ff6d98bdd5f921942eb2b37d313d3b9d18acee40 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 28 Oct 2026 03:43:37 +0100 Subject: get swarm RTT from paths --- src/transport/paths.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/transport/paths.rs') diff --git a/src/transport/paths.rs b/src/transport/paths.rs index 643a238..a9bac49 100644 --- a/src/transport/paths.rs +++ b/src/transport/paths.rs @@ -420,6 +420,11 @@ impl Paths { self.table.lock_or_recover().rank(usable, Instant::now()) } + /// The smoothed round-trip time of the path to `address`, if measured. + pub(crate) fn rtt(&self, address: &str) -> Option { + self.table.lock_or_recover().paths.get(address)?.rtt + } + /// What paths knows about each of `addresses`. pub(crate) fn info(&self, addresses: &[String]) -> Vec { let now = Instant::now(); -- cgit v1.3.1