mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-12 19:07:14 +00:00
Add method to query external addresses (#1022)
This commit is contained in:
parent
ebbe197d9c
commit
03ce6a6ed5
@ -199,6 +199,13 @@ where TBehaviour: NetworkBehaviour,
|
|||||||
RawSwarm::listeners(&me.raw_swarm)
|
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.
|
/// Returns the peer ID of the swarm passed as parameter.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn local_peer_id(me: &Self) -> &PeerId {
|
pub fn local_peer_id(me: &Self) -> &PeerId {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user