mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-24 23:31:33 +00:00
swarm/src/behaviour: Merge inject_* paired methods (#2445)
Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
@ -100,6 +100,7 @@ impl NetworkBehaviour for Behaviour {
|
||||
connection_id: &ConnectionId,
|
||||
connected_point: &ConnectedPoint,
|
||||
_failed_addresses: Option<&Vec<Multiaddr>>,
|
||||
_other_established: usize,
|
||||
) {
|
||||
if connected_point.is_relayed() {
|
||||
if connected_point.is_listener() && !self.direct_connections.contains_key(peer_id) {
|
||||
@ -181,16 +182,13 @@ impl NetworkBehaviour for Behaviour {
|
||||
}
|
||||
}
|
||||
|
||||
fn inject_disconnected(&mut self, peer_id: &PeerId) {
|
||||
assert!(!self.direct_connections.contains_key(peer_id));
|
||||
}
|
||||
|
||||
fn inject_connection_closed(
|
||||
&mut self,
|
||||
peer_id: &PeerId,
|
||||
connection_id: &ConnectionId,
|
||||
connected_point: &ConnectedPoint,
|
||||
_handler: <<Self as NetworkBehaviour>::ProtocolsHandler as IntoProtocolsHandler>::Handler,
|
||||
_remaining_established: usize,
|
||||
) {
|
||||
if !connected_point.is_relayed() {
|
||||
let connections = self
|
||||
|
Reference in New Issue
Block a user