mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-24 07:11:38 +00:00
Fix duplicate external addresses inserted (#927)
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
name = "libp2p-core"
|
||||
edition = "2018"
|
||||
description = "Core traits and structs of libp2p"
|
||||
version = "0.3.3"
|
||||
version = "0.3.4"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/libp2p/rust-libp2p"
|
||||
|
@ -315,8 +315,10 @@ where TBehaviour: NetworkBehaviour,
|
||||
},
|
||||
Async::Ready(NetworkBehaviourAction::ReportObservedAddr { address }) => {
|
||||
for addr in self.raw_swarm.nat_traversal(&address) {
|
||||
if self.external_addrs.iter().all(|a| *a != addr) {
|
||||
self.external_addrs.push(addr);
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user