mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
SU3 resseed first
This commit is contained in:
parent
9ce56eb95f
commit
6ac846f95d
3 changed files with 18 additions and 5 deletions
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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue