mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 08:14:15 +00:00
load certificates before reseed
This commit is contained in:
parent
1ffe7955a3
commit
82d5bf2f8a
@ -78,11 +78,15 @@ namespace data
|
|||||||
void NetDb::Start ()
|
void NetDb::Start ()
|
||||||
{
|
{
|
||||||
Load (m_NetDbPath);
|
Load (m_NetDbPath);
|
||||||
|
if (m_RouterInfos.size () < 100) // reseed if # of router less than 100
|
||||||
|
{
|
||||||
|
Reseeder reseeder;
|
||||||
|
reseeder.LoadCertificates (); // we need certificates for SU3 verification
|
||||||
|
|
||||||
// try SU3 first
|
// try SU3 first
|
||||||
int reseedRetries = 0;
|
int reseedRetries = 0;
|
||||||
while (m_RouterInfos.size () < 100 && reseedRetries < 10)
|
while (m_RouterInfos.size () < 100 && reseedRetries < 10)
|
||||||
{
|
{
|
||||||
Reseeder reseeder;
|
|
||||||
reseeder.ReseedNowSU3();
|
reseeder.ReseedNowSU3();
|
||||||
reseedRetries++;
|
reseedRetries++;
|
||||||
}
|
}
|
||||||
@ -91,11 +95,11 @@ namespace data
|
|||||||
reseedRetries = 0;
|
reseedRetries = 0;
|
||||||
while (m_RouterInfos.size () < 100 && reseedRetries < 10)
|
while (m_RouterInfos.size () < 100 && reseedRetries < 10)
|
||||||
{
|
{
|
||||||
Reseeder reseeder;
|
|
||||||
reseeder.reseedNow();
|
reseeder.reseedNow();
|
||||||
reseedRetries++;
|
reseedRetries++;
|
||||||
Load (m_NetDbPath);
|
Load (m_NetDbPath);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
m_Thread = new std::thread (std::bind (&NetDb::Run, this));
|
m_Thread = new std::thread (std::bind (&NetDb::Run, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user