mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-24 23:31:33 +00:00
Fix invalid state after peer id mismatch (#503)
This commit is contained in:
@ -511,6 +511,10 @@ where
|
|||||||
let num_remain = attempt.next_attempts.len();
|
let num_remain = attempt.next_attempts.len();
|
||||||
let failed_addr = attempt.cur_attempted.clone();
|
let failed_addr = attempt.cur_attempted.clone();
|
||||||
|
|
||||||
|
// Note: at the moment, a peer id mismatch can drop a legitimate connection, which is
|
||||||
|
// why we have to purge `connected_multiaddresses`.
|
||||||
|
// See https://github.com/libp2p/rust-libp2p/issues/502
|
||||||
|
self.connected_multiaddresses.remove(&peer_id);
|
||||||
self.active_nodes.peer_mut(&peer_id)
|
self.active_nodes.peer_mut(&peer_id)
|
||||||
.expect("When we receive a NodeReached or NodeReplaced event from active_nodes, \
|
.expect("When we receive a NodeReached or NodeReplaced event from active_nodes, \
|
||||||
it is guaranteed that the PeerId is valid and therefore that \
|
it is guaranteed that the PeerId is valid and therefore that \
|
||||||
|
Reference in New Issue
Block a user