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