Skip to content

Commit

Permalink
Merge pull request #5987
Browse files Browse the repository at this point in the history
e761d7a Bugfix: Allow mining on top of old tip blocks for testnet (fixes testnet-in-a-box use case) (Luke Dashjr)
  • Loading branch information
laanwj committed Oct 1, 2015
2 parents 8a86d53 + e761d7a commit 4899a04
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/chainparams.cpp
Expand Up @@ -87,6 +87,7 @@ class CMainParams : public CChainParams {
pchMessageStart[3] = 0xd9; pchMessageStart[3] = 0xd9;
vAlertPubKey = ParseHex("04fc9702847840aaf195de8442ebecedf5b095cdbb9bc716bda9110971b28a49e0ead8564ff0db22209e0374782c093bb899692d524e9d6a6956e7c5ecbcd68284"); vAlertPubKey = ParseHex("04fc9702847840aaf195de8442ebecedf5b095cdbb9bc716bda9110971b28a49e0ead8564ff0db22209e0374782c093bb899692d524e9d6a6956e7c5ecbcd68284");
nDefaultPort = 8333; nDefaultPort = 8333;
nMaxTipAge = 24 * 60 * 60;
nPruneAfterHeight = 100000; nPruneAfterHeight = 100000;


genesis = CreateGenesisBlock(1231006505, 2083236893, 0x1d00ffff, 1, 50 * COIN); genesis = CreateGenesisBlock(1231006505, 2083236893, 0x1d00ffff, 1, 50 * COIN);
Expand Down Expand Up @@ -160,6 +161,7 @@ class CTestNetParams : public CChainParams {
pchMessageStart[3] = 0x07; pchMessageStart[3] = 0x07;
vAlertPubKey = ParseHex("04302390343f91cc401d56d68b123028bf52e5fca1939df127f63c6467cdf9c8e2c14b61104cf817d0b780da337893ecc4aaff1309e536162dabbdb45200ca2b0a"); vAlertPubKey = ParseHex("04302390343f91cc401d56d68b123028bf52e5fca1939df127f63c6467cdf9c8e2c14b61104cf817d0b780da337893ecc4aaff1309e536162dabbdb45200ca2b0a");
nDefaultPort = 18333; nDefaultPort = 18333;
nMaxTipAge = 0x7fffffff;
nPruneAfterHeight = 1000; nPruneAfterHeight = 1000;


genesis = CreateGenesisBlock(1296688602, 414098458, 0x1d00ffff, 1, 50 * COIN); genesis = CreateGenesisBlock(1296688602, 414098458, 0x1d00ffff, 1, 50 * COIN);
Expand Down Expand Up @@ -220,6 +222,7 @@ class CRegTestParams : public CChainParams {
pchMessageStart[1] = 0xbf; pchMessageStart[1] = 0xbf;
pchMessageStart[2] = 0xb5; pchMessageStart[2] = 0xb5;
pchMessageStart[3] = 0xda; pchMessageStart[3] = 0xda;
nMaxTipAge = 24 * 60 * 60;
nDefaultPort = 18444; nDefaultPort = 18444;
nPruneAfterHeight = 1000; nPruneAfterHeight = 1000;


Expand Down
2 changes: 2 additions & 0 deletions src/chainparams.h
Expand Up @@ -64,6 +64,7 @@ class CChainParams
bool DefaultConsistencyChecks() const { return fDefaultConsistencyChecks; } bool DefaultConsistencyChecks() const { return fDefaultConsistencyChecks; }
/** Policy: Filter transactions that do not match well-defined patterns */ /** Policy: Filter transactions that do not match well-defined patterns */
bool RequireStandard() const { return fRequireStandard; } bool RequireStandard() const { return fRequireStandard; }
int64_t MaxTipAge() const { return nMaxTipAge; }
int64_t PruneAfterHeight() const { return nPruneAfterHeight; } int64_t PruneAfterHeight() const { return nPruneAfterHeight; }
/** Make miner stop after a block is found. In RPC, don't return until nGenProcLimit blocks are generated */ /** Make miner stop after a block is found. In RPC, don't return until nGenProcLimit blocks are generated */
bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; } bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; }
Expand All @@ -83,6 +84,7 @@ class CChainParams
//! Raw pub key bytes for the broadcast alert signing key. //! Raw pub key bytes for the broadcast alert signing key.
std::vector<unsigned char> vAlertPubKey; std::vector<unsigned char> vAlertPubKey;
int nDefaultPort; int nDefaultPort;
long nMaxTipAge;
uint64_t nPruneAfterHeight; uint64_t nPruneAfterHeight;
std::vector<CDNSSeedData> vSeeds; std::vector<CDNSSeedData> vSeeds;
std::vector<unsigned char> base58Prefixes[MAX_BASE58_TYPES]; std::vector<unsigned char> base58Prefixes[MAX_BASE58_TYPES];
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Expand Up @@ -1112,7 +1112,7 @@ bool IsInitialBlockDownload()
if (lockIBDState) if (lockIBDState)
return false; return false;
bool state = (chainActive.Height() < pindexBestHeader->nHeight - 24 * 6 || bool state = (chainActive.Height() < pindexBestHeader->nHeight - 24 * 6 ||
pindexBestHeader->GetBlockTime() < GetTime() - 24 * 60 * 60); pindexBestHeader->GetBlockTime() < GetTime() - chainParams.MaxTipAge());
if (!state) if (!state)
lockIBDState = true; lockIBDState = true;
return state; return state;
Expand Down

0 comments on commit 4899a04

Please sign in to comment.