RequireHeight differs for mainnet and testnet

This commit is contained in:
Roman Mindalev 2013-08-09 11:25:54 +04:00
parent 562d95e6ca
commit 30b80788f7
2 changed files with 7 additions and 3 deletions

View File

@ -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();

8
db.h
View File

@ -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;