Skip to content

Commit

Permalink
fix fPowAllowMinDifficultyBlocks implementation on testnet so that it…
Browse files Browse the repository at this point in the history
… only affects block 277300 and onwards
  • Loading branch information
kay kurokawa authored and kaykurokawa committed May 25, 2018
1 parent 4e147cb commit 5d22b17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
if (pindexLast == NULL)
return nProofOfWorkLimit;

if (params.fPowAllowMinDifficultyBlocks)
if (params.fPowAllowMinDifficultyBlocks && pindexLast->nHeight >= 277299)
{
// Special difficulty rule for testnet:
// If the new block's timestamp is twice the target block time
// then allow mining of a min-difficulty block.
// This is to prevent the testnet from gettig stuck when a large amount
// of hashrate drops off the network.
// This rule was not implemented properly until testnet block 277299.
if (pblock->GetBlockTime() > pindexLast->GetBlockTime() + params.nPowTargetSpacing*2){
return nProofOfWorkLimit;
}
Expand Down

0 comments on commit 5d22b17

Please sign in to comment.