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