Skip to content

Commit

Permalink
Fix regtest: pow.cpp
Browse files Browse the repository at this point in the history
Fix error which happens on block 0 (genesis) and later on regtest
- `CheckProofOfWork() : hash doesn't match nBits`
  • Loading branch information
cevap authored and FornaxA committed Feb 5, 2019
1 parent bf6cf19 commit aa226d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits)
return error("CheckProofOfWork() : nBits below minimum work");

// Check proof of work matches claimed amount
if (hash > bnTarget)
if (hash > bnTarget && Params().NetworkID() != CBaseChainParams::REGTEST)
return error("CheckProofOfWork() : hash doesn't match nBits");

return true;
Expand Down

0 comments on commit aa226d1

Please sign in to comment.