diff --git a/src/seeder/bitcoin.h b/src/seeder/bitcoin.h --- a/src/seeder/bitcoin.h +++ b/src/seeder/bitcoin.h @@ -75,7 +75,4 @@ int GetStartingHeight() { return nStartingHeight; } }; -bool TestNode(const CService &cip, int &ban, int &client, std::string &clientSV, - int &blocks, std::vector *vAddr); - #endif // BITCOIN_SEEDER_BITCOIN_H diff --git a/src/seeder/bitcoin.cpp b/src/seeder/bitcoin.cpp --- a/src/seeder/bitcoin.cpp +++ b/src/seeder/bitcoin.cpp @@ -327,26 +327,3 @@ sock = INVALID_SOCKET; return (ban == 0) && res; } - -bool TestNode(const CService &cip, int &ban, int &clientV, - std::string &clientSV, int &blocks, - std::vector *vAddr) { - try { - CSeederNode node(cip, vAddr); - bool ret = node.Run(); - if (!ret) { - ban = node.GetBan(); - } else { - ban = 0; - } - clientV = node.GetClientVersion(); - clientSV = node.GetClientSubVersion(); - blocks = node.GetStartingHeight(); - // tfm::format(std::cout, "%s: %s!!!\n", cip.ToString().c_str(), ret ? - // "GOOD" : "BAD"); - return ret; - } catch (std::ios_base::failure &e) { - ban = 0; - return false; - } -} diff --git a/src/seeder/main.cpp b/src/seeder/main.cpp --- a/src/seeder/main.cpp +++ b/src/seeder/main.cpp @@ -190,9 +190,24 @@ res.nHeight = 0; res.strClientV = ""; bool getaddr = res.ourLastSuccess + 86400 < now; - res.fGood = TestNode(res.service, res.nBanTime, res.nClientV, - res.strClientV, res.nHeight, - getaddr ? &addr : nullptr); + try { + CSeederNode node(res.service, getaddr ? &addr : nullptr); + bool ret = node.Run(); + if (!ret) { + res.nBanTime = node.GetBan(); + } else { + res.nBanTime = 0; + } + res.nClientV = node.GetClientVersion(); + res.strClientV = node.GetClientSubVersion(); + res.nHeight = node.GetStartingHeight(); + // tfm::format(std::cout, "%s: %s!!!\n", cip.ToString().c_str(), + // ret ? "GOOD" : "BAD"); + res.fGood = ret; + } catch (std::ios_base::failure &e) { + res.nBanTime = 0; + res.fGood = false; + } } db.ResultMany(ips);