diff --git a/src/seeder/db.h b/src/seeder/db.h --- a/src/seeder/db.h +++ b/src/seeder/db.h @@ -95,6 +95,9 @@ int success; std::string clientSubVersion; +protected: + int GetTotal() const { return total; } + public: CAddrInfo() : services(0), lastTry(0), ourLastTry(0), ourLastSuccess(0), @@ -265,6 +268,7 @@ int nClientV; std::string strClientV; int64_t ourLastSuccess; + int totalTries; }; /** diff --git a/src/seeder/db.cpp b/src/seeder/db.cpp --- a/src/seeder/db.cpp +++ b/src/seeder/db.cpp @@ -69,6 +69,8 @@ } else { ip.service = idToInfo[ret].ip; ip.ourLastSuccess = idToInfo[ret].ourLastSuccess; + ip.totalTries = idToInfo[ret].GetTotal(); + ip.fGood = idToInfo[ret].IsGood(); break; } } while (1); diff --git a/src/seeder/main.cpp b/src/seeder/main.cpp --- a/src/seeder/main.cpp +++ b/src/seeder/main.cpp @@ -191,9 +191,15 @@ res.nHeight = 0; res.strClientV = ""; bool getaddr = res.ourLastSuccess + 86400 < now; + bool wasReliable = res.fGood; + int64_t timeSinceLastSuccess = now - res.ourLastSuccess; res.fGood = TestNode(res.service, res.nBanTime, res.nClientV, res.strClientV, res.nHeight, getaddr ? &addr : nullptr); + if (!res.fGood && !wasReliable && res.totalTries > 0 && + timeSinceLastSuccess > 2 * 86400) { + res.nBanTime = std::max(100000, res.nBanTime); + } } db.ResultMany(ips);