diff --git a/bitcoin.cpp b/bitcoin.cpp index 720126a..cf1c016 100644 --- a/bitcoin.cpp +++ b/bitcoin.cpp @@ -79,7 +79,7 @@ class CNode { int64 nLocalServices = 0; CAddress me(CService("0.0.0.0")); BeginMessage("version"); - int nBestHeight = REQUIRE_HEIGHT; + int nBestHeight = GetRequireHeight(); string ver = "/bitcoin-seeder:0.01/"; vSend << PROTOCOL_VERSION << nLocalServices << nTime << you << me << nLocalNonce << ver << nBestHeight; EndMessage(); diff --git a/db.h b/db.h index 65b48b1..307dd40 100644 --- a/db.h +++ b/db.h @@ -12,9 +12,13 @@ #define MIN_RETRY 1000 -#define REQUIRE_HEIGHT 230000 #define REQUIRE_VERSION 40000 +static inline int GetRequireHeight(const bool testnet = fTestNet) +{ + return testnet ? 0 : 230000; +} + std::string static inline ToString(const CService &ip) { std::string str = ip.ToString(); while (str.size() < 22) str += ' '; @@ -101,7 +105,7 @@ public: if (!(services & NODE_NETWORK)) return false; if (!ip.IsRoutable()) return false; if (clientVersion && clientVersion < REQUIRE_VERSION) return false; - if (blocks && blocks < REQUIRE_HEIGHT) return false; + if (blocks && blocks < GetRequireHeight()) return false; if (total <= 3 && success * 2 >= total) return true;