Skip to content
This repository was archived by the owner on Oct 23, 2022. It is now read-only.

Commit 31adc2e

Browse files
committed
fix: restore access to tracked connections in find_peer
1 parent 7ae8ff9 commit 31adc2e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/p2p/swarm.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@ impl SwarmApi {
145145
.map(|addrs| addrs.into_iter().map(From::from).collect())
146146
.unwrap_or_default()
147147
}
148+
149+
pub fn connections_to(&self, peer_id: &PeerId) -> Vec<Multiaddr> {
150+
self.connected_peers
151+
.get(peer_id)
152+
.cloned()
153+
.map(|addrs| addrs.into_iter().map(From::from).collect())
154+
.unwrap_or_default()
155+
}
148156
}
149157

150158
impl NetworkBehaviour for SwarmApi {

0 commit comments

Comments
 (0)