Browse Source

RequireHeight differs for mainnet and testnet

pull/1/head
Roman Mindalev 11 years ago
parent
commit
30b80788f7
  1. 2
      bitcoin.cpp
  2. 8
      db.h

2
bitcoin.cpp

@ -79,7 +79,7 @@ class CNode { @@ -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

@ -12,9 +12,13 @@ @@ -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: @@ -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;

Loading…
Cancel
Save