Remove testnet-only difficulty rules

The min-difficulty blocks are incompatible with difficulty averaging.

Network difficulty is also now defined as the difficulty the network is
currently working to solve, rather than the last non-min-difficulty block
difficulty.
This commit is contained in:
Jack Grigg
2016-09-05 23:06:20 +12:00
parent 29842505cc
commit 333ea3c426
3 changed files with 9 additions and 61 deletions

View File

@@ -24,23 +24,6 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
if (pindexLast == NULL)
return nProofOfWorkLimit;
const CBlockIndex* pindexBits = pindexLast;
{
if (params.fPowAllowMinDifficultyBlocks)
{
// Special difficulty rule for testnet:
// If the new block's timestamp is more than 2* 2.5 minutes
// then allow mining of a min-difficulty block.
if (pblock->GetBlockTime() > pindexLast->GetBlockTime() + params.nPowTargetSpacing*2)
return nProofOfWorkLimit;
else {
// Get the last non-min-difficulty (or at worst the genesis difficulty)
while (pindexBits->pprev && pindexBits->nBits == nProofOfWorkLimit)
pindexBits = pindexBits->pprev;
}
}
}
// Find the first block in the averaging interval
const CBlockIndex* pindexFirst = pindexLast;
arith_uint256 bnAvg;