Don't add as an explicit peer if already connected

This commit is contained in:
Luke Parker
2024-03-22 23:51:51 -04:00
parent f11a08c436
commit 4914420a37

View File

@@ -438,7 +438,7 @@ impl LibP2p {
Some(SwarmEvent::ConnectionEstablished { peer_id, connection_id, .. }) => {
if &peer_id == swarm.local_peer_id() {
swarm.close_connection(connection_id);
} else {
} else if swarm.is_connected(&peer_id) {} else {
log::debug!(
"connection established to peer {} in connection ID {}",
&peer_id,