diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-02-04 19:29:39 -0800 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-02-04 19:29:39 -0800 |
commit | 594cb1fad8db5b551982ae948d43a01b25494f05 (patch) | |
tree | c18a2d76f232d703e1500ddf9512ed2277c50eac /node/Topology.cpp | |
parent | 5eab6c2e5db4c7a1a99aa32cd18c1512a1a5173f (diff) | |
download | infinitytier-594cb1fad8db5b551982ae948d43a01b25494f05.tar.gz infinitytier-594cb1fad8db5b551982ae948d43a01b25494f05.zip |
Small fix for duplicates in world definitions.
Diffstat (limited to 'node/Topology.cpp')
-rw-r--r-- | node/Topology.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/node/Topology.cpp b/node/Topology.cpp index f19d8656..0fde63dc 100644 --- a/node/Topology.cpp +++ b/node/Topology.cpp @@ -421,7 +421,7 @@ void Topology::_memoizeUpstreams() for(std::vector<World::Root>::const_iterator i(_planet.roots().begin());i!=_planet.roots().end();++i) { if (i->identity == RR->identity) { _amRoot = true; - } else { + } else if (std::find(_upstreamAddresses.begin(),_upstreamAddresses.end(),i->identity.address()) == _upstreamAddresses.end()) { _upstreamAddresses.push_back(i->identity.address()); SharedPtr<Peer> &hp = _peers[i->identity.address()]; if (!hp) { @@ -435,7 +435,7 @@ void Topology::_memoizeUpstreams() for(std::vector<World::Root>::const_iterator i(m->roots().begin());i!=m->roots().end();++i) { if (i->identity == RR->identity) { _amRoot = true; - } else { + } else if (std::find(_upstreamAddresses.begin(),_upstreamAddresses.end(),i->identity.address()) == _upstreamAddresses.end()) { _upstreamAddresses.push_back(i->identity.address()); SharedPtr<Peer> &hp = _peers[i->identity.address()]; if (!hp) { |