From d7959009790a422ebb17d4c4ab1d9be3d48dc511 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 28 Oct 2026 17:38:16 +0100 Subject: list libp2p relays in document --- src/transport/paths.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/transport/paths.rs') diff --git a/src/transport/paths.rs b/src/transport/paths.rs index 2fe534a..3baa092 100644 --- a/src/transport/paths.rs +++ b/src/transport/paths.rs @@ -480,6 +480,19 @@ impl Paths { .map(Link::own_address) } + /// Relays listed for the swarm (`Transport::learn_relays`): to each transport the + /// addresses with its scheme, without it. + pub(crate) fn learn_relays(&self, addresses: &[String]) { + for link in &self.links { + let targets: Vec = addresses + .iter() + .filter_map(|address| address.strip_prefix(link.scheme)?.strip_prefix(':')) + .map(str::to_owned) + .collect(); + link.inner.learn_relays(&targets); + } + } + /// This node's own addresses, one per transport: `:`. pub(crate) fn own_addresses(&self) -> Vec { self.links.iter().map(Link::own_address).collect() -- cgit v1.3.1