mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
don't load non-reachable routers
This commit is contained in:
parent
d512c90193
commit
3961fdc2e1
2 changed files with 24 additions and 10 deletions
24
NetDb.cpp
24
NetDb.cpp
|
@ -267,15 +267,25 @@ namespace data
|
|||
for (boost::filesystem::directory_iterator it1 (it->path ()); it1 != end; ++it1)
|
||||
{
|
||||
#if BOOST_VERSION > 10500
|
||||
RouterInfo * r = new RouterInfo (it1->path().string());
|
||||
const std::string& fullPath = it1->path().string();
|
||||
#else
|
||||
RouterInfo * r = new RouterInfo(it1->path());
|
||||
const std::string& fullPath = it1->path();
|
||||
#endif
|
||||
r->DeleteBuffer ();
|
||||
m_RouterInfos[r->GetIdentHash ()] = r;
|
||||
if (r->IsFloodfill ())
|
||||
m_Floodfills.push_back (r);
|
||||
numRouters++;
|
||||
RouterInfo * r = new RouterInfo(fullPath);
|
||||
if (!r->IsUnreachable ())
|
||||
{
|
||||
r->DeleteBuffer ();
|
||||
m_RouterInfos[r->GetIdentHash ()] = r;
|
||||
if (r->IsFloodfill ())
|
||||
m_Floodfills.push_back (r);
|
||||
numRouters++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (boost::filesystem::exists (fullPath))
|
||||
boost::filesystem::remove (fullPath);
|
||||
delete r;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue