Seperate block height restrictions and feature activation #116
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR moves the helpers to get the lastest block height etc. into
utilsbitcoin
, and the block height restrictions, as well as the allowed input and output types intorules
.The enum
BLOCKHEIGHTRESTRICTIONS
was flattened to plain numbers.From here on, I see a few options:
mastercore::consensus::P2SH_BLOCK
IsEnabled_P2SH()
main
,test
,regtest
)Params()
(see: chainparams.h, chainparams.cpp, chainparamsbase.cpp)To go on with #104, it could basically go like this: old, already enabled features remain to have hardcoded
const int
block height restrictions, while the not-yet-enabled features are changed toint
. There could be a function likeEnableFeature_XXX(int block)
, which would update these values.