From ecdb60b44e4827aa1973124e94cd2cc5f31a02d6 Mon Sep 17 00:00:00 2001 From: orignal Date: Mon, 14 Nov 2016 16:23:42 -0500 Subject: [PATCH] cleanup netdb after failed reseed --- NetDb.h | 2 +- Reseed.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NetDb.h b/NetDb.h index 94c8a086..f6d64309 100644 --- a/NetDb.h +++ b/NetDb.h @@ -99,7 +99,7 @@ namespace data void VisitRouterInfos(RouterInfoVisitor v); /** visit N random router that match using filter, then visit them with a visitor, return number of RouterInfos that were visited */ size_t VisitRandomRouterInfos(RouterInfoFilter f, RouterInfoVisitor v, size_t n); - + void ClearRouterInfos () { m_RouterInfos.clear (); }; private: diff --git a/Reseed.cpp b/Reseed.cpp index 8c8cc881..3ea69eff 100644 --- a/Reseed.cpp +++ b/Reseed.cpp @@ -312,7 +312,7 @@ namespace data i2p::data::netdb.VisitRouterInfos ( [&numOutdated, ts](std::shared_ptr r) { - if (r && ts > r->GetTimestamp () + 3*i2p::data::NETDB_MAX_EXPIRATION_TIMEOUT*1000LL) // 81 hours + if (r && ts > r->GetTimestamp () + 10*i2p::data::NETDB_MAX_EXPIRATION_TIMEOUT*1000LL) // 270 hours { LogPrint (eLogError, "Reseed: router ", r->GetIdentHash().ToBase64 (), " is outdated by ", (ts - r->GetTimestamp ())/1000LL/3600LL, " hours"); numOutdated++; @@ -329,7 +329,8 @@ namespace data " **_________**\n" " *_________*\n" " ***___***"); - numFiles = numFiles > numOutdated ? numFiles - numOutdated : 0; + i2p::data::netdb.ClearRouterInfos (); + numFiles = 0; } } return numFiles;