swarm/src/behaviour: Merge inject_* paired methods (#2445)

Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
Divma
2022-02-09 10:08:28 -05:00
committed by GitHub
parent 5a95a46cd3
commit dc8433e3fc
30 changed files with 583 additions and 481 deletions

View File

@ -127,8 +127,17 @@ impl NetworkBehaviour for Mdns {
}
}
fn inject_disconnected(&mut self, peer: &PeerId) {
self.expire_node(peer);
fn inject_connection_closed(
&mut self,
peer: &PeerId,
_: &libp2p_core::connection::ConnectionId,
_: &libp2p_core::ConnectedPoint,
_: Self::ProtocolsHandler,
remaining_established: usize,
) {
if remaining_established == 0 {
self.expire_node(peer);
}
}
fn poll(