diff options
Diffstat (limited to 'src/transport/libp2p/driver.rs')
| -rw-r--r-- | src/transport/libp2p/driver.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/transport/libp2p/driver.rs b/src/transport/libp2p/driver.rs index c89a784..39a2a5d 100644 --- a/src/transport/libp2p/driver.rs +++ b/src/transport/libp2p/driver.rs @@ -272,6 +272,19 @@ pub(super) async fn run( } SwarmEvent::OutgoingConnectionError { connection_id, peer_id, error } => { count_dial_failure(&mut lock(&book).counts.dial_failures, &error); + // Another peer there: not this one's address, though it said so (a + // NATed peer's LAN address, the same range as ours). + if let (Some(peer), ::libp2p::swarm::DialError::WrongPeerId { obtained, address }) = + (peer_id, &error) + { + debug!( + peer = %Addressed(SCHEME, &peer), + address = %address, + obtained = %obtained, + "Another peer at an address of this one; not dialling it there again" + ); + lock(&book).not_theirs(peer, address.clone()); + } if let Some((_, done)) = identifying.remove(&connection_id) { let _ = done.send(Err(describe_dial_error(&error))); } |
