Surface logic in Topology.
This commit is contained in:
parent
61cff47f5b
commit
37d23336ed
3 changed files with 32 additions and 1 deletions
|
@ -258,6 +258,24 @@ void Topology::clean(uint64_t now)
|
|||
}
|
||||
}
|
||||
|
||||
bool Topology::updateSurface(const SharedPtr<Peer> &remotePeer,const InetAddress &mirroredAddress)
|
||||
{
|
||||
Mutex::Lock _l(_lock);
|
||||
|
||||
if (std::find(_supernodeAddresses.begin(),_supernodeAddresses.end(),remotePeer->address()) == _supernodeAddresses.end())
|
||||
return false;
|
||||
|
||||
if (_surface.update(mirroredAddress)) {
|
||||
// Clear non-fixed paths for all peers
|
||||
for(std::map< Address,SharedPtr<Peer> >::const_iterator ap(_activePeers.begin());ap!=_activePeers.end();++ap)
|
||||
ap->second->clearPaths(false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Topology::authenticateRootTopology(const Dictionary &rt)
|
||||
{
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue