|
|
|
@ -494,7 +494,8 @@ namespace data
@@ -494,7 +494,8 @@ namespace data
|
|
|
|
|
{ |
|
|
|
|
auto r = std::make_shared<RouterInfo>(path); |
|
|
|
|
if (r->GetRouterIdentity () && !r->IsUnreachable () && r->HasValidAddresses () && |
|
|
|
|
ts < r->GetTimestamp () + 24*60*60*NETDB_MAX_OFFLINE_EXPIRATION_TIMEOUT*1000LL) |
|
|
|
|
ts < r->GetTimestamp () + 24*60*60*NETDB_MAX_OFFLINE_EXPIRATION_TIMEOUT*1000LL && // too old
|
|
|
|
|
ts + NETDB_EXPIRATION_TIMEOUT_THRESHOLD*1000LL > r->GetTimestamp ()) // from future
|
|
|
|
|
{ |
|
|
|
|
r->DeleteBuffer (); |
|
|
|
|
if (m_RouterInfos.emplace (r->GetIdentHash (), r).second) |
|
|
|
@ -638,6 +639,11 @@ namespace data
@@ -638,6 +639,11 @@ namespace data
|
|
|
|
|
} |
|
|
|
|
else if (checkForExpiration && ts > it.second->GetTimestamp () + expirationTimeout) |
|
|
|
|
it.second->SetUnreachable (true); |
|
|
|
|
else if (ts + NETDB_EXPIRATION_TIMEOUT_THRESHOLD*1000LL < it.second->GetTimestamp ()) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogWarning, "NetDb: RouterInfo is from future for ", (it.second->GetTimestamp () - ts)/1000LL, " seconds"); |
|
|
|
|
it.second->SetUnreachable (true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (it.second->IsUnreachable ()) |
|
|
|
|
{ |
|
|
|
|