Skip to content

Commit

Permalink
test: remove fSkipProofOfWork
Browse files Browse the repository at this point in the history
Not used, and REGTEST already allows creating blocks at
the lowerst possible difficulty.
  • Loading branch information
laanwj committed Mar 9, 2015
1 parent 59bd89f commit 3aa0130
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 9 deletions.
1 change: 0 additions & 1 deletion src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ class CMainParams : public CChainParams {
fAllowMinDifficultyBlocks = false;
fRequireStandard = true;
fMineBlocksOnDemand = false;
fSkipProofOfWorkCheck = false;
fTestnetToBeDeprecatedFieldRPC = false;
}

Expand Down
3 changes: 0 additions & 3 deletions src/chainparams.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ class CChainParams
bool DefaultCheckMemPool() const { return fDefaultCheckMemPool; }
/** Allow mining of a min-difficulty block */
bool AllowMinDifficultyBlocks() const { return fAllowMinDifficultyBlocks; }
/** Skip proof-of-work check: allow mining of any difficulty block */
bool SkipProofOfWorkCheck() const { return fSkipProofOfWorkCheck; }
/** Make standard checks */
bool RequireStandard() const { return fRequireStandard; }
int64_t TargetTimespan() const { return nTargetTimespan; }
Expand Down Expand Up @@ -104,7 +102,6 @@ class CChainParams
bool fAllowMinDifficultyBlocks;
bool fRequireStandard;
bool fMineBlocksOnDemand;
bool fSkipProofOfWorkCheck;
bool fTestnetToBeDeprecatedFieldRPC;
};

Expand Down
3 changes: 1 addition & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2593,8 +2593,7 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
int nHeight = pindexPrev->nHeight+1;

// Check proof of work
if ((!Params().SkipProofOfWorkCheck()) &&
(block.nBits != GetNextWorkRequired(pindexPrev, &block)))
if ((block.nBits != GetNextWorkRequired(pindexPrev, &block)))
return state.DoS(100, error("%s: incorrect proof of work", __func__),
REJECT_INVALID, "bad-diffbits");

Expand Down
3 changes: 0 additions & 3 deletions src/pow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits)
bool fOverflow;
arith_uint256 bnTarget;

if (Params().SkipProofOfWorkCheck())
return true;

bnTarget.SetCompact(nBits, &fNegative, &fOverflow);

// Check range
Expand Down

0 comments on commit 3aa0130

Please sign in to comment.