Skip to content

Commit b9a83d2

Browse files
authored
Allow mining min diff for very slow (2h+) blocks (#2175)
1 parent 7b9919d commit b9a83d2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/pow.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ unsigned int static DarkGravityWave(const CBlockIndex* pindexLast, const CBlockH
109109
if (pindexLast->nChainWork >= UintToArith256(uint256S("0x000000000000000000000000000000000000000000000000003ff00000000000"))
110110
// and immediately on devnet
111111
|| !params.hashDevnetGenesisBlock.IsNull()) {
112+
// recent block is more than 2 hours old
113+
if (pblock->GetBlockTime() > pindexLast->GetBlockTime() + 2 * 60 * 60) {
114+
return bnPowLimit.GetCompact();
115+
}
116+
// recent block is more than 10 minutes old
112117
if (pblock->GetBlockTime() > pindexLast->GetBlockTime() + params.nPowTargetSpacing*4) {
113118
arith_uint256 bnNew = arith_uint256().SetCompact(pindexLast->nBits) * 10;
114119
if (bnNew > bnPowLimit) {

0 commit comments

Comments
 (0)