Browse Source

test: remove fSkipProofOfWork

Not used, and REGTEST already allows creating blocks at
the lowerst possible difficulty.
0.13
Wladimir J. van der Laan 10 years ago
parent
commit
3aa0130b96
  1. 1
      src/chainparams.cpp
  2. 3
      src/chainparams.h
  3. 3
      src/main.cpp
  4. 3
      src/pow.cpp

1
src/chainparams.cpp

@ -170,7 +170,6 @@ public: @@ -170,7 +170,6 @@ public:
fAllowMinDifficultyBlocks = false;
fRequireStandard = true;
fMineBlocksOnDemand = false;
fSkipProofOfWorkCheck = false;
fTestnetToBeDeprecatedFieldRPC = false;
}

3
src/chainparams.h

@ -60,8 +60,6 @@ public: @@ -60,8 +60,6 @@ public:
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; }
@ -104,7 +102,6 @@ protected: @@ -104,7 +102,6 @@ protected:
bool fAllowMinDifficultyBlocks;
bool fRequireStandard;
bool fMineBlocksOnDemand;
bool fSkipProofOfWorkCheck;
bool fTestnetToBeDeprecatedFieldRPC;
};

3
src/main.cpp

@ -2593,8 +2593,7 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta @@ -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");

3
src/pow.cpp

@ -87,9 +87,6 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits) @@ -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

Loading…
Cancel
Save