mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 05:07:55 +00:00
Don't print "Discovered new external" line for private IPs (#10055)
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user