mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
SU3 resseed first
This commit is contained in:
17
NetDb.cpp
17
NetDb.cpp
@@ -62,7 +62,7 @@ namespace data
|
||||
#endif
|
||||
NetDb netdb;
|
||||
|
||||
NetDb::NetDb (): m_IsRunning (false), m_ReseedRetries (0), m_Thread (0)
|
||||
NetDb::NetDb (): m_IsRunning (false), m_Thread (0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -78,11 +78,22 @@ namespace data
|
||||
void NetDb::Start ()
|
||||
{
|
||||
Load (m_NetDbPath);
|
||||
while (m_RouterInfos.size () < 100 && m_ReseedRetries < 10)
|
||||
// try SU3 first
|
||||
int reseedRetries = 0;
|
||||
while (m_RouterInfos.size () < 100 && reseedRetries < 10)
|
||||
{
|
||||
Reseeder reseeder;
|
||||
reseeder.ReseedNowSU3();
|
||||
reseedRetries++;
|
||||
}
|
||||
|
||||
// if still not enough download .dat files
|
||||
reseedRetries = 0;
|
||||
while (m_RouterInfos.size () < 100 && reseedRetries < 10)
|
||||
{
|
||||
Reseeder reseeder;
|
||||
reseeder.reseedNow();
|
||||
m_ReseedRetries++;
|
||||
reseedRetries++;
|
||||
Load (m_NetDbPath);
|
||||
}
|
||||
m_Thread = new std::thread (std::bind (&NetDb::Run, this));
|
||||
|
||||
Reference in New Issue
Block a user