mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
Use DeploymentEnabled to hide VB deployments
The helper was previously unused. This commit changes it to be more meaningful and puts it to use. See previous discussion at https://github.com/bitcoin/bitcoin/pull/19438/files#r650687320
This commit is contained in:
parent
fa11fecf0d
commit
fa5658ed07
2 changed files with 4 additions and 5 deletions
|
@ -49,7 +49,7 @@ inline bool DeploymentEnabled(const Consensus::Params& params, Consensus::Buried
|
|||
inline bool DeploymentEnabled(const Consensus::Params& params, Consensus::DeploymentPos dep)
|
||||
{
|
||||
assert(Consensus::ValidDeployment(dep));
|
||||
return params.vDeployments[dep].nTimeout != 0;
|
||||
return params.vDeployments[dep].nStartTime != Consensus::BIP9Deployment::NEVER_ACTIVE;
|
||||
}
|
||||
|
||||
#endif // BITCOIN_DEPLOYMENTSTATUS_H
|
||||
|
|
|
@ -1350,8 +1350,7 @@ static RPCHelpMan verifychain()
|
|||
static void SoftForkDescPushBack(const CBlockIndex* active_chain_tip, UniValue& softforks, const Consensus::Params& params, Consensus::BuriedDeployment dep)
|
||||
{
|
||||
// For buried deployments.
|
||||
// Buried deployments with activation height value of
|
||||
// std::numeric_limits<int>::max() are disabled and thus hidden.
|
||||
|
||||
if (!DeploymentEnabled(params, dep)) return;
|
||||
|
||||
UniValue rv(UniValue::VOBJ);
|
||||
|
@ -1366,8 +1365,8 @@ static void SoftForkDescPushBack(const CBlockIndex* active_chain_tip, UniValue&
|
|||
static void SoftForkDescPushBack(const CBlockIndex* active_chain_tip, UniValue& softforks, const Consensus::Params& consensusParams, Consensus::DeploymentPos id)
|
||||
{
|
||||
// For BIP9 deployments.
|
||||
// Deployments that are never active are hidden.
|
||||
if (consensusParams.vDeployments[id].nStartTime == Consensus::BIP9Deployment::NEVER_ACTIVE) return;
|
||||
|
||||
if (!DeploymentEnabled(consensusParams, id)) return;
|
||||
|
||||
UniValue bip9(UniValue::VOBJ);
|
||||
const ThresholdState thresholdState = g_versionbitscache.State(active_chain_tip, consensusParams, id);
|
||||
|
|
Loading…
Add table
Reference in a new issue