Skip to content

Commit

Permalink
Minimal changes to v1.4.17 to allow testnet to work.
Browse files Browse the repository at this point in the history
  • Loading branch information
dooglus committed Dec 25, 2015
1 parent 6723832 commit 81b8bcd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
10 changes: 6 additions & 4 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,17 @@ class CTestNetParams : public CMainParams {
pchMessageStart[3] = 0xdf;
bnProofOfWorkLimit = CBigNum(~uint256(0) >> 16);
vAlertPubKey = ParseHex("0471dc165db490094d35cde15b1f5d755fa6ad6f2b5ed0f340e3f17f57389c3c2af113a8cbcc885bde73305a553b5640c83021128008ddf882e856336269080496");
nDefaultPort = 25714;
nRPCPort = 25715;
nDefaultPort = 35714;
nRPCPort = 35715;
strDataDir = "testnet";

// Modify the testnet genesis block so the timestamp is valid for a later start.
genesis.nBits = bnProofOfWorkLimit.GetCompact();
genesis.nNonce = 1279100;
genesis.nTime = 1397512438;
genesis.nNonce = 15165;

hashGenesisBlock = genesis.GetHash();
assert(hashGenesisBlock == uint256("0x0000135b14723652fecaeb07a52cebf3f69512594eae48d139956bca67552441"));
assert(hashGenesisBlock == uint256("0x00001924120e93f445dd4adb9d90e0020350b8c6c2b08e1a4950372a37f8bcc8"));

vFixedSeeds.clear();
vSeeds.clear();
Expand Down
5 changes: 4 additions & 1 deletion src/checkpoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ namespace Checkpoints
;

// TestNet has no checkpoints
static MapCheckpoints mapCheckpointsTestnet;
static MapCheckpoints mapCheckpointsTestnet =
boost::assign::map_list_of
( 0, hashGenesisBlockTestNet )
;


bool CheckHardened(int nHeight, const uint256& hash)
Expand Down
4 changes: 2 additions & 2 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ static const unsigned int LOCKTIME_THRESHOLD = 500000000; // Tue Nov 5 00:53:20
static const unsigned int MAX_TX_COMMENT_LEN = 140; // 128 bytes + little extra

static const uint256 hashGenesisBlock("0x00000c3ce6b3d823a35224a39798eca9ad889966aeb5a9da7b960ffb9869db35");
static const uint256 hashGenesisBlockTestNet("0x0000135b14723652fecaeb07a52cebf3f69512594eae48d139956bca67552441");
static const uint256 hashGenesisBlockTestNet("0x00001924120e93f445dd4adb9d90e0020350b8c6c2b08e1a4950372a37f8bcc8");

static const uint256 hashHighBlock ("0xdb61f591d7fb40afa08476d6492e81a06edddf332d7027968ac130db95c07cb7");
static const int HIGH_BLOCK_INDEX = 275000;


inline bool IsProtocolV2(int nHeight) { return nHeight > 203500; }
inline bool IsProtocolV2(int nHeight) { return TestNet() || nHeight > 203500; }

inline int64_t PastDrift(int64_t nTime, int nHeight) { return IsProtocolV2(nHeight) ? nTime : nTime - 10 * 60; }

Expand Down

0 comments on commit 81b8bcd

Please sign in to comment.