Skip to content

Commit

Permalink
Add method to query external addresses (#1022)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaka authored Mar 28, 2019
1 parent ebbe197 commit 03ce6a6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/src/swarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Item = &Multiaddr> {
me.external_addrs.iter()
}

/// Returns the peer ID of the swarm passed as parameter.
#[inline]
pub fn local_peer_id(me: &Self) -> &PeerId {
Expand Down

0 comments on commit 03ce6a6

Please sign in to comment.