|
|
@ -473,15 +473,16 @@ namespace data |
|
|
|
bool NetDb::LoadRouterInfo (const std::string & path) |
|
|
|
bool NetDb::LoadRouterInfo (const std::string & path) |
|
|
|
{ |
|
|
|
{ |
|
|
|
auto r = std::make_shared<RouterInfo>(path); |
|
|
|
auto r = std::make_shared<RouterInfo>(path); |
|
|
|
if (r->GetRouterIdentity () && !r->IsUnreachable () && |
|
|
|
if (r->GetRouterIdentity () && !r->IsUnreachable () && r->HasValidAddresses ()) |
|
|
|
(r->IsReachable () || !r->IsSSU (false) || m_LastLoad < r->GetTimestamp () + NETDB_INTRODUCEE_EXPIRATION_TIMEOUT*1000LL)) // 1 hour
|
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
r->DeleteBuffer (); |
|
|
|
r->DeleteBuffer (); |
|
|
|
r->ClearProperties (); // properties are not used for regular routers
|
|
|
|
r->ClearProperties (); // properties are not used for regular routers
|
|
|
|
m_RouterInfos[r->GetIdentHash ()] = r; |
|
|
|
if (m_RouterInfos.emplace (r->GetIdentHash (), r).second) |
|
|
|
if (r->IsFloodfill () && r->IsReachable ()) // floodfill must be reachable
|
|
|
|
{ |
|
|
|
|
|
|
|
if (r->IsFloodfill () && r->IsEligibleFloodfill ()) |
|
|
|
m_Floodfills.push_back (r); |
|
|
|
m_Floodfills.push_back (r); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
LogPrint(eLogWarning, "NetDb: RI from ", path, " is invalid. Delete"); |
|
|
|
LogPrint(eLogWarning, "NetDb: RI from ", path, " is invalid. Delete"); |
|
|
|