Skip to content

Commit 3aa0130

Browse files
committed
test: remove fSkipProofOfWork
Not used, and REGTEST already allows creating blocks at the lowerst possible difficulty.
1 parent 59bd89f commit 3aa0130

File tree

4 files changed

+1
-9
lines changed

4 files changed

+1
-9
lines changed

src/chainparams.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ class CMainParams : public CChainParams {
170170
fAllowMinDifficultyBlocks = false;
171171
fRequireStandard = true;
172172
fMineBlocksOnDemand = false;
173-
fSkipProofOfWorkCheck = false;
174173
fTestnetToBeDeprecatedFieldRPC = false;
175174
}
176175

src/chainparams.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ class CChainParams
6060
bool DefaultCheckMemPool() const { return fDefaultCheckMemPool; }
6161
/** Allow mining of a min-difficulty block */
6262
bool AllowMinDifficultyBlocks() const { return fAllowMinDifficultyBlocks; }
63-
/** Skip proof-of-work check: allow mining of any difficulty block */
64-
bool SkipProofOfWorkCheck() const { return fSkipProofOfWorkCheck; }
6563
/** Make standard checks */
6664
bool RequireStandard() const { return fRequireStandard; }
6765
int64_t TargetTimespan() const { return nTargetTimespan; }
@@ -104,7 +102,6 @@ class CChainParams
104102
bool fAllowMinDifficultyBlocks;
105103
bool fRequireStandard;
106104
bool fMineBlocksOnDemand;
107-
bool fSkipProofOfWorkCheck;
108105
bool fTestnetToBeDeprecatedFieldRPC;
109106
};
110107

src/main.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2593,8 +2593,7 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
25932593
int nHeight = pindexPrev->nHeight+1;
25942594

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

src/pow.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits)
8787
bool fOverflow;
8888
arith_uint256 bnTarget;
8989

90-
if (Params().SkipProofOfWorkCheck())
91-
return true;
92-
9390
bnTarget.SetCompact(nBits, &fNegative, &fOverflow);
9491

9592
// Check range

0 commit comments

Comments
 (0)