donn't calculate routing keys for routers anymore

This commit is contained in:
orignal 2014-10-14 10:41:40 -04:00
parent 030c04de81
commit 09dc649101
7 changed files with 19 additions and 50 deletions

View file

@ -102,7 +102,7 @@ namespace data
void NetDb::Run ()
{
uint32_t lastSave = 0, lastPublish = 0, lastKeyspaceRotation = 0;
uint32_t lastSave = 0, lastPublish = 0;
m_IsRunning = true;
while (m_IsRunning)
{
@ -158,11 +158,6 @@ namespace data
Publish ();
lastPublish = ts;
}
if (ts % 86400 < 60 && ts - lastKeyspaceRotation >= 60) // wihhin 1 minutes since midnight (86400 = 24*3600)
{
KeyspaceRotation ();
lastKeyspaceRotation = ts;
}
}
catch (std::exception& ex)
{
@ -863,14 +858,14 @@ namespace data
{
RouterInfo * r = nullptr;
XORMetric minMetric;
RoutingKey destKey = CreateRoutingKey (destination);
IdentHash destKey = CreateRoutingKey (destination);
minMetric.SetMax ();
std::unique_lock<std::mutex> l(m_FloodfillsMutex);
for (auto it: m_Floodfills)
{
if (!it->IsUnreachable () && !excluded.count (it->GetIdentHash ()))
{
XORMetric m = destKey ^ it->GetRoutingKey ();
XORMetric m = destKey ^ it->GetIdentHash ();
if (m < minMetric)
{
minMetric = m;
@ -910,14 +905,6 @@ namespace data
}
}
void NetDb::KeyspaceRotation ()
{
for (auto it: m_RouterInfos)
it.second->UpdateRoutingKey ();
LogPrint ("Keyspace rotation complete");
Publish ();
}
void NetDb::ManageLeaseSets ()
{
for (auto it = m_LeaseSets.begin (); it != m_LeaseSets.end ();)