[client/network] remove peer entry from ephemeral_addresses (#13084)

* [client/network] remove peer entry from `ephemeral_addresses`

if there are no addresses associated with that peer

* refactor as per @bkchr suggestion

https://github.com/paritytech/substrate/pull/13084#discussion_r1068028534

* add missing import

* fix error
This commit is contained in:
Anton
2023-02-06 10:21:51 +04:00
committed by GitHub
parent 294726874c
commit 7539d4d8d6
2 changed files with 18 additions and 12 deletions
+1 -1
View File
@@ -534,7 +534,7 @@ where
self.network_service.behaviour().user_protocol().num_sync_requests()
}
/// Adds an address for a node.
/// Adds an address known to a node.
pub fn add_known_address(&mut self, peer_id: PeerId, addr: Multiaddr) {
self.network_service.behaviour_mut().add_known_address(peer_id, addr);
}