diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-09-29 13:13:47 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-10-02 13:54:26 +0200 |
commit | fbd36d8fb5245a5511b2db7a35270fb1250e21d5 (patch) | |
tree | dc789112db6935d255a88fd457bd2cb77e65f488 /src | |
parent | f0fd00cb77d91ec9ac729bc4cf35ff7d9f676d8f (diff) |
Avoid introducing a virtual into CChainParams
Treat fSkipProofOfWorkCheck the same as other parameters.
Diffstat (limited to 'src')
-rw-r--r-- | src/chainparams.cpp | 5 | ||||
-rw-r--r-- | src/chainparams.h | 3 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 8a00da0bb5..31c67715c8 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -115,6 +115,7 @@ public: fAllowMinDifficultyBlocks = false; fRequireStandard = true; fMineBlocksOnDemand = false; + fSkipProofOfWorkCheck = false; } }; static CMainParams mainParams; @@ -231,11 +232,7 @@ public: fDefaultCheckMemPool = true; fAllowMinDifficultyBlocks = false; fMineBlocksOnDemand = true; - fSkipProofOfWorkCheck = false; } - virtual bool SkipProofOfWorkCheck() const { return fSkipProofOfWorkCheck; } -protected: - bool fSkipProofOfWorkCheck; public: // Published setters to allow changing values in unit test cases virtual void setSubsidyHalvingInterval(int anSubsidyHalvingInterval) { nSubsidyHalvingInterval=anSubsidyHalvingInterval; } diff --git a/src/chainparams.h b/src/chainparams.h index 171a590a5f..50441a89f3 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -62,7 +62,7 @@ public: /* Allow mining of a min-difficulty block */ bool AllowMinDifficultyBlocks() const { return fAllowMinDifficultyBlocks; } /* 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 */ bool RequireStandard() const { return fRequireStandard; } int64_t TargetTimespan() const { return nTargetTimespan; } @@ -105,6 +105,7 @@ protected: bool fAllowMinDifficultyBlocks; bool fRequireStandard; bool fMineBlocksOnDemand; + bool fSkipProofOfWorkCheck; }; /** Modifiable parameters interface is used by test cases to adapt the parameters in order |