[NetDb] check PersistProfiles on load

* tabulation fixes
This commit is contained in:
R4SAS 2019-02-22 18:32:50 +03:00
parent d40a029dae
commit d8a4954bf1

View file

@ -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
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
++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 ();)