Skip to content

Commit

Permalink
Check for required block height in IsGood to ensure nodes not meeting…
Browse files Browse the repository at this point in the history
… the requirement are indexed properly
  • Loading branch information
luke-jr committed Apr 15, 2013
1 parent 89fb42e commit d8e20ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 0 additions & 2 deletions bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#include "uint256.h"

#define BITCOIN_SEED_NONCE 0x0539a019ca550825
#define REQUIRE_HEIGHT 140700
#define MIN_VERSION 40000

using namespace std;

Expand Down
6 changes: 5 additions & 1 deletion db.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

#define MIN_RETRY 1000

#define REQUIRE_HEIGHT 140700
#define REQUIRE_VERSION 40000

std::string static inline ToString(const CService &ip) {
std::string str = ip.ToString();
while (str.size() < 22) str += ' ';
Expand Down Expand Up @@ -90,7 +93,8 @@ class CAddrInfo {
if (ip.GetPort() != 8333) return false;
if (!(services & NODE_NETWORK)) return false;
if (!ip.IsRoutable()) return false;
if (clientVersion && clientVersion < 32400) return false;
if (clientVersion && clientVersion < REQUIRE_VERSION) return false;
if (blocks && blocks < REQUIRE_HEIGHT) return false;

if (total <= 3 && success * 2 >= total) return true;

Expand Down

0 comments on commit d8e20ba

Please sign in to comment.