Browse Source

[NetDb] check PersistProfiles on load

* tabulation fixes
pull/1285/merge
R4SAS 6 years ago
parent
commit
d8a4954bf1
  1. 8
      libi2pd/NetDb.cpp

8
libi2pd/NetDb.cpp

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

Loading…
Cancel
Save