mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
donn't calculate routing keys for routers anymore
This commit is contained in:
parent
030c04de81
commit
09dc649101
7 changed files with 19 additions and 50 deletions
19
NetDb.cpp
19
NetDb.cpp
|
@ -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 ();)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue