mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-18 23:36:39 +01:00
load certificates before reseed
This commit is contained in:
parent
1ffe7955a3
commit
82d5bf2f8a
1 changed files with 19 additions and 15 deletions
32
NetDb.cpp
32
NetDb.cpp
|
@ -78,23 +78,27 @@ namespace data
|
||||||
void NetDb::Start ()
|
void NetDb::Start ()
|
||||||
{
|
{
|
||||||
Load (m_NetDbPath);
|
Load (m_NetDbPath);
|
||||||
// try SU3 first
|
if (m_RouterInfos.size () < 100) // reseed if # of router less than 100
|
||||||
int reseedRetries = 0;
|
|
||||||
while (m_RouterInfos.size () < 100 && reseedRetries < 10)
|
|
||||||
{
|
{
|
||||||
Reseeder reseeder;
|
Reseeder reseeder;
|
||||||
reseeder.ReseedNowSU3();
|
reseeder.LoadCertificates (); // we need certificates for SU3 verification
|
||||||
reseedRetries++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if still not enough download .dat files
|
// try SU3 first
|
||||||
reseedRetries = 0;
|
int reseedRetries = 0;
|
||||||
while (m_RouterInfos.size () < 100 && reseedRetries < 10)
|
while (m_RouterInfos.size () < 100 && reseedRetries < 10)
|
||||||
{
|
{
|
||||||
Reseeder reseeder;
|
reseeder.ReseedNowSU3();
|
||||||
reseeder.reseedNow();
|
reseedRetries++;
|
||||||
reseedRetries++;
|
}
|
||||||
Load (m_NetDbPath);
|
|
||||||
|
// if still not enough download .dat files
|
||||||
|
reseedRetries = 0;
|
||||||
|
while (m_RouterInfos.size () < 100 && reseedRetries < 10)
|
||||||
|
{
|
||||||
|
reseeder.reseedNow();
|
||||||
|
reseedRetries++;
|
||||||
|
Load (m_NetDbPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
m_Thread = new std::thread (std::bind (&NetDb::Run, this));
|
m_Thread = new std::thread (std::bind (&NetDb::Run, this));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue