Browse Source

load certificates before reseed

pull/118/head
orignal 10 years ago
parent
commit
82d5bf2f8a
  1. 8
      NetDb.cpp

8
NetDb.cpp

@ -78,11 +78,15 @@ namespace data @@ -78,11 +78,15 @@ namespace data
void NetDb::Start ()
{
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
int reseedRetries = 0;
while (m_RouterInfos.size () < 100 && reseedRetries < 10)
{
Reseeder reseeder;
reseeder.ReseedNowSU3();
reseedRetries++;
}
@ -91,11 +95,11 @@ namespace data @@ -91,11 +95,11 @@ namespace data
reseedRetries = 0;
while (m_RouterInfos.size () < 100 && reseedRetries < 10)
{
Reseeder reseeder;
reseeder.reseedNow();
reseedRetries++;
Load (m_NetDbPath);
}
}
m_Thread = new std::thread (std::bind (&NetDb::Run, this));
}

Loading…
Cancel
Save