diff --git a/src/seeder/bitcoin.h b/src/seeder/bitcoin.h --- a/src/seeder/bitcoin.h +++ b/src/seeder/bitcoin.h @@ -77,6 +77,8 @@ std::string GetClientSubVersion() { return strSubVer; } int GetStartingHeight() { return nStartingHeight; } + + uint64_t GetServices() { return you.nServices; } }; #endif // BITCOIN_SEEDER_BITCOIN_H diff --git a/src/seeder/db.h b/src/seeder/db.h --- a/src/seeder/db.h +++ b/src/seeder/db.h @@ -243,6 +243,7 @@ struct CServiceResult { CService service; + uint64_t services; bool fGood; int nBanTime; int nHeight; @@ -285,7 +286,7 @@ bool Get_(CServiceResult &ip, int &wait); // mark an IP as good (must have been returned by Get_) void Good_(const CService &ip, int clientV, std::string clientSV, - int blocks); + int blocks, uint64_t services); // mark an IP as bad (and optionally ban it) (must have been returned by // Get_) void Bad_(const CService &ip, int ban); @@ -425,7 +426,7 @@ for (size_t i = 0; i < ips.size(); i++) { if (ips[i].fGood) { Good_(ips[i].service, ips[i].nClientV, ips[i].strClientV, - ips[i].nHeight); + ips[i].nHeight, ips[i].services); } else { Bad_(ips[i].service, ips[i].nBanTime); } diff --git a/src/seeder/db.cpp b/src/seeder/db.cpp --- a/src/seeder/db.cpp +++ b/src/seeder/db.cpp @@ -87,7 +87,7 @@ } void CAddrDb::Good_(const CService &addr, int clientV, std::string clientSV, - int blocks) { + int blocks, uint64_t services) { int id = Lookup_(addr); if (id == -1) { return; @@ -98,6 +98,7 @@ info.clientVersion = clientV; info.clientSubVersion = clientSV; info.blocks = blocks; + info.services = services; info.Update(true); if (info.IsReliable() && goodId.count(id) == 0) { goodId.insert(id); diff --git a/src/seeder/main.cpp b/src/seeder/main.cpp --- a/src/seeder/main.cpp +++ b/src/seeder/main.cpp @@ -211,6 +211,7 @@ res.nClientV = 0; res.nHeight = 0; res.strClientV = ""; + res.services = 0; bool getaddr = res.ourLastSuccess + 86400 < now; try { CSeederNode node(res.service, getaddr ? &addr : nullptr); @@ -223,6 +224,7 @@ res.nClientV = node.GetClientVersion(); res.strClientV = node.GetClientSubVersion(); res.nHeight = node.GetStartingHeight(); + res.services = node.GetServices(); // tfm::format(std::cout, "%s: %s!!!\n", cip.ToString(), // ret ? "GOOD" : "BAD"); res.fGood = ret;