Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Don't print "Discovered new external" line for private IPs (#10055)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaka committed Oct 19, 2021
1 parent d1ec40b commit 781454d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions client/network/src/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,14 +599,16 @@ impl NetworkBehaviour for DiscoveryBehaviour {
fn inject_new_external_addr(&mut self, addr: &Multiaddr) {
let new_addr = addr.clone().with(Protocol::P2p(self.local_peer_id.into()));

// NOTE: we might re-discover the same address multiple times
// in which case we just want to refrain from logging.
if self.known_external_addresses.insert(new_addr.clone()) {
info!(
target: "sub-libp2p",
"🔍 Discovered new external address for our node: {}",
new_addr,
);
if self.can_add_to_dht(addr) {
// NOTE: we might re-discover the same address multiple times
// in which case we just want to refrain from logging.
if self.known_external_addresses.insert(new_addr.clone()) {
info!(
target: "sub-libp2p",
"🔍 Discovered new external address for our node: {}",
new_addr,
);
}
}

for k in self.kademlias.values_mut() {
Expand Down

0 comments on commit 781454d

Please sign in to comment.