|
|
@ -319,6 +319,9 @@ namespace data |
|
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<RouterProfile> NetDb::FindRouterProfile (const IdentHash& ident) const |
|
|
|
std::shared_ptr<RouterProfile> NetDb::FindRouterProfile (const IdentHash& ident) const |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if (!m_PersistProfiles) |
|
|
|
|
|
|
|
return nullptr; |
|
|
|
|
|
|
|
|
|
|
|
auto router = FindRouter (ident); |
|
|
|
auto router = FindRouter (ident); |
|
|
|
return router ? router->GetProfile () : nullptr; |
|
|
|
return router ? router->GetProfile () : nullptr; |
|
|
|
} |
|
|
|
} |
|
|
@ -418,7 +421,8 @@ namespace data |
|
|
|
|
|
|
|
|
|
|
|
void NetDb::VisitStoredRouterInfos(RouterInfoVisitor v) |
|
|
|
void NetDb::VisitStoredRouterInfos(RouterInfoVisitor v) |
|
|
|
{ |
|
|
|
{ |
|
|
|
m_Storage.Iterate([v] (const std::string & filename) { |
|
|
|
m_Storage.Iterate([v] (const std::string & filename) |
|
|
|
|
|
|
|
{ |
|
|
|
auto ri = std::make_shared<i2p::data::RouterInfo>(filename); |
|
|
|
auto ri = std::make_shared<i2p::data::RouterInfo>(filename); |
|
|
|
v(ri); |
|
|
|
v(ri); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -555,7 +559,7 @@ namespace data |
|
|
|
++it; |
|
|
|
++it; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// clean up expired floodfiils
|
|
|
|
// clean up expired floodfills
|
|
|
|
{ |
|
|
|
{ |
|
|
|
std::unique_lock<std::mutex> l(m_FloodfillsMutex); |
|
|
|
std::unique_lock<std::mutex> l(m_FloodfillsMutex); |
|
|
|
for (auto it = m_Floodfills.begin (); it != m_Floodfills.end ();) |
|
|
|
for (auto it = m_Floodfills.begin (); it != m_Floodfills.end ();) |
|
|
|