diff --git a/core/src/swarm.rs b/core/src/swarm.rs index ea60dd69..7a3e4be7 100644 --- a/core/src/swarm.rs +++ b/core/src/swarm.rs @@ -199,6 +199,13 @@ where TBehaviour: NetworkBehaviour, RawSwarm::listeners(&me.raw_swarm) } + /// Returns an iterator that produces the list of addresses that other nodes can use to reach + /// us. + #[inline] + pub fn external_addresses(me: &Self) -> impl Iterator { + me.external_addrs.iter() + } + /// Returns the peer ID of the swarm passed as parameter. #[inline] pub fn local_peer_id(me: &Self) -> &PeerId {