|
|
@ -61,6 +61,8 @@ public: |
|
|
|
bool DefaultCheckMemPool() const { return fDefaultCheckMemPool; } |
|
|
|
bool DefaultCheckMemPool() const { return fDefaultCheckMemPool; } |
|
|
|
/* 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 */ |
|
|
|
|
|
|
|
virtual bool SkipProofOfWorkCheck() const { return false; } |
|
|
|
/* 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 +107,24 @@ protected: |
|
|
|
bool fMineBlocksOnDemand; |
|
|
|
bool fMineBlocksOnDemand; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Modifiable parameters interface is used by test cases to adapt the parameters in order
|
|
|
|
|
|
|
|
*** to test specific features more easily. Test cases should always restore the previous |
|
|
|
|
|
|
|
*** values after finalization. |
|
|
|
|
|
|
|
**/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CModifiableParams { |
|
|
|
|
|
|
|
public: |
|
|
|
|
|
|
|
// Published setters to allow changing values in unit test cases
|
|
|
|
|
|
|
|
virtual void setSubsidyHalvingInterval(int anSubsidyHalvingInterval) =0; |
|
|
|
|
|
|
|
virtual void setEnforceBlockUpgradeMajority(int anEnforceBlockUpgradeMajority)=0; |
|
|
|
|
|
|
|
virtual void setRejectBlockOutdatedMajority(int anRejectBlockOutdatedMajority)=0; |
|
|
|
|
|
|
|
virtual void setToCheckBlockUpgradeMajority(int anToCheckBlockUpgradeMajority)=0; |
|
|
|
|
|
|
|
virtual void setDefaultCheckMemPool(bool aDefaultCheckMemPool)=0; |
|
|
|
|
|
|
|
virtual void setAllowMinDifficultyBlocks(bool aAllowMinDifficultyBlocks)=0; |
|
|
|
|
|
|
|
virtual void setSkipProofOfWorkCheck(bool aSkipProofOfWorkCheck)=0; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Return the currently selected parameters. This won't change after app startup |
|
|
|
* Return the currently selected parameters. This won't change after app startup |
|
|
|
* outside of the unit tests. |
|
|
|
* outside of the unit tests. |
|
|
@ -114,6 +134,9 @@ const CChainParams &Params(); |
|
|
|
/** Return parameters for the given network. */ |
|
|
|
/** Return parameters for the given network. */ |
|
|
|
CChainParams &Params(CBaseChainParams::Network network); |
|
|
|
CChainParams &Params(CBaseChainParams::Network network); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Get modifyable network parameters (UNITTEST only) */ |
|
|
|
|
|
|
|
CModifiableParams *ModifiableParams(); |
|
|
|
|
|
|
|
|
|
|
|
/** Sets the params returned by Params() to those for the given network. */ |
|
|
|
/** Sets the params returned by Params() to those for the given network. */ |
|
|
|
void SelectParams(CBaseChainParams::Network network); |
|
|
|
void SelectParams(CBaseChainParams::Network network); |
|
|
|
|
|
|
|
|
|
|
|