swarm: Extend NetworkBehaviour callbacks. (#2011)

Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
David Craven
2021-03-24 17:21:53 +01:00
committed by GitHub
parent be2fb4ea8a
commit 7779b8e2c1
9 changed files with 155 additions and 49 deletions

View File

@ -26,7 +26,7 @@ use libp2p_core::{
Multiaddr,
PeerId,
PublicKey,
connection::ConnectionId,
connection::{ConnectionId, ListenerId},
upgrade::UpgradeError
};
use libp2p_swarm::{
@ -233,13 +233,13 @@ impl NetworkBehaviour for Identify {
self.pending_push.remove(peer_id);
}
fn inject_new_listen_addr(&mut self, _addr: &Multiaddr) {
fn inject_new_listen_addr(&mut self, _id: ListenerId, _addr: &Multiaddr) {
if self.config.push_listen_addr_updates {
self.pending_push.extend(self.connected.keys());
}
}
fn inject_expired_listen_addr(&mut self, _addr: &Multiaddr) {
fn inject_expired_listen_addr(&mut self, _id: ListenerId, _addr: &Multiaddr) {
if self.config.push_listen_addr_updates {
self.pending_push.extend(self.connected.keys());
}