File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -599,14 +599,16 @@ impl NetworkBehaviour for DiscoveryBehaviour {
599599 fn inject_new_external_addr ( & mut self , addr : & Multiaddr ) {
600600 let new_addr = addr. clone ( ) . with ( Protocol :: P2p ( self . local_peer_id . into ( ) ) ) ;
601601
602- // NOTE: we might re-discover the same address multiple times
603- // in which case we just want to refrain from logging.
604- if self . known_external_addresses . insert ( new_addr. clone ( ) ) {
605- info ! (
606- target: "sub-libp2p" ,
607- "🔍 Discovered new external address for our node: {}" ,
608- new_addr,
609- ) ;
602+ if self . can_add_to_dht ( addr) {
603+ // NOTE: we might re-discover the same address multiple times
604+ // in which case we just want to refrain from logging.
605+ if self . known_external_addresses . insert ( new_addr. clone ( ) ) {
606+ info ! (
607+ target: "sub-libp2p" ,
608+ "🔍 Discovered new external address for our node: {}" ,
609+ new_addr,
610+ ) ;
611+ }
610612 }
611613
612614 for k in self . kademlias . values_mut ( ) {
You can’t perform that action at this time.
0 commit comments