diff --git a/src/consensus/params.h b/src/consensus/params.h index 2840ecf50f..9c1aea3ac0 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -22,6 +22,7 @@ enum DeploymentPos DEPLOYMENT_TESTDUMMY, DEPLOYMENT_CSV, // Deployment of BIP68, BIP112, and BIP113. DEPLOYMENT_SEGWIT, // Deployment of BIP141, BIP143, and BIP147. + DEPLOYMENT_DYNA_FED, // Deployment of dynamic federation // NOTE: Also add new deployments to VersionBitsDeploymentInfo in versionbits.cpp MAX_VERSION_BITS_DEPLOYMENTS }; diff --git a/src/validation.cpp b/src/validation.cpp index 6aa7afb9cd..e7602a7f39 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -3371,6 +3371,12 @@ bool IsNullDummyEnabled(const CBlockIndex* pindexPrev, const Consensus::Params& return (VersionBitsState(pindexPrev, params, Consensus::DEPLOYMENT_SEGWIT, versionbitscache) == ThresholdState::ACTIVE); } +bool IsDynaFedEnabled(const CBlockIndex* pindexPrev, const Consensus::Params& params) +{ + LOCK(cs_main); + return (VersionBitsState(pindexPrev, params, Consensus::DEPLOYMENT_DYNA_FED, versionbitscache) == ThresholdState::ACTIVE); +} + // Compute at which vout of the block's coinbase transaction the witness // commitment occurs, or -1 if not found. static int GetWitnessCommitmentIndex(const CBlock& block) diff --git a/src/validation.h b/src/validation.h index abdcc530fc..2c89fd8299 100644 --- a/src/validation.h +++ b/src/validation.h @@ -410,6 +410,9 @@ bool IsWitnessEnabled(const CBlockIndex* pindexPrev, const Consensus::Params& pa /** Check whether NULLDUMMY (BIP 147) has activated. */ bool IsNullDummyEnabled(const CBlockIndex* pindexPrev, const Consensus::Params& params); +/** Check whether Dynamic Federation has activated. */ +bool IsDynaFedEnabled(const CBlockIndex* pindexPrev, const Consensus::Params& params); + /** When there are blocks in the active chain with missing data, rewind the chainstate and remove them from the block index */ bool RewindBlockIndex(const CChainParams& params);