Browse Source

Avoid introducing a virtual into CChainParams

Treat fSkipProofOfWorkCheck the same as other parameters.
0.10
Wladimir J. van der Laan 10 years ago
parent
commit
4705902777
  1. 5
      src/chainparams.cpp
  2. 3
      src/chainparams.h

5
src/chainparams.cpp

@ -115,6 +115,7 @@ public:
fAllowMinDifficultyBlocks = false; fAllowMinDifficultyBlocks = false;
fRequireStandard = true; fRequireStandard = true;
fMineBlocksOnDemand = false; fMineBlocksOnDemand = false;
fSkipProofOfWorkCheck = false;
} }
}; };
static CMainParams mainParams; static CMainParams mainParams;
@ -231,11 +232,7 @@ public:
fDefaultCheckMemPool = true; fDefaultCheckMemPool = true;
fAllowMinDifficultyBlocks = false; fAllowMinDifficultyBlocks = false;
fMineBlocksOnDemand = true; fMineBlocksOnDemand = true;
fSkipProofOfWorkCheck = false;
} }
virtual bool SkipProofOfWorkCheck() const { return fSkipProofOfWorkCheck; }
protected:
bool fSkipProofOfWorkCheck;
public: public:
// Published setters to allow changing values in unit test cases // Published setters to allow changing values in unit test cases
virtual void setSubsidyHalvingInterval(int anSubsidyHalvingInterval) { nSubsidyHalvingInterval=anSubsidyHalvingInterval; } virtual void setSubsidyHalvingInterval(int anSubsidyHalvingInterval) { nSubsidyHalvingInterval=anSubsidyHalvingInterval; }

3
src/chainparams.h

@ -62,7 +62,7 @@ public:
/* Allow mining of a min-difficulty block */ /* Allow mining of a min-difficulty block */
bool AllowMinDifficultyBlocks() const { return fAllowMinDifficultyBlocks; } bool AllowMinDifficultyBlocks() const { return fAllowMinDifficultyBlocks; }
/* Skip proof-of-work check: allow mining of any difficulty block */ /* Skip proof-of-work check: allow mining of any difficulty block */
virtual bool SkipProofOfWorkCheck() const { return false; } bool SkipProofOfWorkCheck() const { return fSkipProofOfWorkCheck; }
/* Make standard checks */ /* Make standard checks */
bool RequireStandard() const { return fRequireStandard; } bool RequireStandard() const { return fRequireStandard; }
int64_t TargetTimespan() const { return nTargetTimespan; } int64_t TargetTimespan() const { return nTargetTimespan; }
@ -105,6 +105,7 @@ protected:
bool fAllowMinDifficultyBlocks; bool fAllowMinDifficultyBlocks;
bool fRequireStandard; bool fRequireStandard;
bool fMineBlocksOnDemand; bool fMineBlocksOnDemand;
bool fSkipProofOfWorkCheck;
}; };
/** Modifiable parameters interface is used by test cases to adapt the parameters in order /** Modifiable parameters interface is used by test cases to adapt the parameters in order

Loading…
Cancel
Save