mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-08 21:48:02 +00:00
@@ -499,12 +499,19 @@ where
|
||||
fn inject_dial_failure(&mut self, peer_id: Option<&PeerId>, addr: &Multiaddr, error: &dyn error::Error) {
|
||||
if let Some(peer_id) = peer_id.as_ref() {
|
||||
debug!(target: "sub-libp2p", "Failed to reach peer {:?} through {} => {:?}", peer_id, addr, error);
|
||||
if self.connected_peers.contains(peer_id) {
|
||||
self.topology.set_unreachable(addr);
|
||||
}
|
||||
self.topology.set_unreachable(addr);
|
||||
|
||||
// Trigger a `connect_to_nodes` round.
|
||||
self.next_connect_to_nodes = Delay::new(Instant::now());
|
||||
|
||||
} else {
|
||||
// This code path is only reached if `peer_id` is None, which means that we dialed an
|
||||
// address without knowing the `PeerId` to expect. We don't currently do that, except
|
||||
// in one situation: for convenience, we accept bootstrap node addresses in the format
|
||||
// `IP:PORT`.
|
||||
// There is no reason this trigger a `connect_to_nodes` round in that situation.
|
||||
debug!(target: "sub-libp2p", "Failed to reach {} => {:?}", addr, error);
|
||||
self.topology.set_unreachable(addr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user