Surface logic in Topology.

This commit is contained in:
Adam Ierymenko 2015-02-02 16:23:26 -08:00
parent 61cff47f5b
commit 37d23336ed
3 changed files with 32 additions and 1 deletions

View file

@ -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 {