Skip to content

Commit

Permalink
fix: remove duplicate if local
Browse files Browse the repository at this point in the history
  • Loading branch information
grumbach committed Jan 8, 2025
1 parent 8d8a1c9 commit d77b844
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions ant-networking/src/event/swarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,16 +292,14 @@ impl SwarmDriver {
if self.local {
match *mdns_event {
mdns::Event::Discovered(list) => {
if self.local {
for (peer_id, addr) in list {
// The multiaddr does not contain the peer ID, so add it.
let addr = addr.with(Protocol::P2p(peer_id));
for (peer_id, addr) in list {
// The multiaddr does not contain the peer ID, so add it.
let addr = addr.with(Protocol::P2p(peer_id));

info!(%addr, "mDNS node discovered and dialing");
info!(%addr, "mDNS node discovered and dialing");

if let Err(err) = self.dial(addr.clone()) {
warn!(%addr, "mDNS node dial error: {err:?}");
}
if let Err(err) = self.dial(addr.clone()) {
warn!(%addr, "mDNS node dial error: {err:?}");
}
}
}
Expand Down

0 comments on commit d77b844

Please sign in to comment.