Skip to content

Commit f361b41

Browse files
committed
expose Behaviour::connected and Behaviour::addresses
Signed-off-by: ozkanonur <[email protected]>
1 parent b23a4a7 commit f361b41

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

protocols/autonat/src/behaviour.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ pub struct Behaviour {
199199
// Connected peers with the observed address of each connection.
200200
// If the endpoint of a connection is relayed or not global (in case of Config::only_global_ips),
201201
// the observed address is `None`.
202-
connected: HashMap<PeerId, HashMap<ConnectionId, Option<Multiaddr>>>,
202+
pub connected: HashMap<PeerId, HashMap<ConnectionId, Option<Multiaddr>>>,
203203

204204
// Used servers in recent outbound probes that are throttled through Config::throttle_server_period.
205205
throttled_servers: Vec<(PeerId, Instant)>,

protocols/identify/src/behaviour.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ use std::{
4747
pub struct Behaviour {
4848
config: Config,
4949
/// For each peer we're connected to, the observed address to send back to it.
50-
connected: HashMap<PeerId, HashMap<ConnectionId, Multiaddr>>,
50+
pub connected: HashMap<PeerId, HashMap<ConnectionId, Multiaddr>>,
5151
/// Pending events to be emitted when polled.
5252
events: VecDeque<ToSwarm<Event, InEvent>>,
5353
/// The addresses of all peers that we have discovered.

protocols/request-response/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,9 @@ where
332332
VecDeque<ToSwarm<Event<TCodec::Request, TCodec::Response>, RequestProtocol<TCodec>>>,
333333
/// The currently connected peers, their pending outbound and inbound responses and their known,
334334
/// reachable addresses, if any.
335-
connected: HashMap<PeerId, SmallVec<[Connection; 2]>>,
335+
pub connected: HashMap<PeerId, SmallVec<[Connection; 2]>>,
336336
/// Externally managed addresses via `add_address` and `remove_address`.
337-
addresses: HashMap<PeerId, SmallVec<[Multiaddr; 6]>>,
337+
pub addresses: HashMap<PeerId, SmallVec<[Multiaddr; 6]>>,
338338
/// Requests that have not yet been sent and are waiting for a connection
339339
/// to be established.
340340
pending_outbound_requests: HashMap<PeerId, SmallVec<[RequestProtocol<TCodec>; 10]>>,

0 commit comments

Comments
 (0)