Skip to content

Commit

Permalink
Allow mining min diff for very slow (2h+) blocks (dashpay#2175)
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 committed Jul 8, 2018
1 parent 7b9919d commit b9a83d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ unsigned int static DarkGravityWave(const CBlockIndex* pindexLast, const CBlockH
if (pindexLast->nChainWork >= UintToArith256(uint256S("0x000000000000000000000000000000000000000000000000003ff00000000000"))
// and immediately on devnet
|| !params.hashDevnetGenesisBlock.IsNull()) {
// recent block is more than 2 hours old
if (pblock->GetBlockTime() > pindexLast->GetBlockTime() + 2 * 60 * 60) {
return bnPowLimit.GetCompact();
}
// recent block is more than 10 minutes old
if (pblock->GetBlockTime() > pindexLast->GetBlockTime() + params.nPowTargetSpacing*4) {
arith_uint256 bnNew = arith_uint256().SetCompact(pindexLast->nBits) * 10;
if (bnNew > bnPowLimit) {
Expand Down

0 comments on commit b9a83d2

Please sign in to comment.