Skip to content

Commit fa5658e

Browse files
author
MarcoFalke
committed
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
1 parent fa11fec commit fa5658e

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/deploymentstatus.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ inline bool DeploymentEnabled(const Consensus::Params& params, Consensus::Buried
4949
inline bool DeploymentEnabled(const Consensus::Params& params, Consensus::DeploymentPos dep)
5050
{
5151
assert(Consensus::ValidDeployment(dep));
52-
return params.vDeployments[dep].nTimeout != 0;
52+
return params.vDeployments[dep].nStartTime != Consensus::BIP9Deployment::NEVER_ACTIVE;
5353
}
5454

5555
#endif // BITCOIN_DEPLOYMENTSTATUS_H

src/rpc/blockchain.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,8 +1350,7 @@ static RPCHelpMan verifychain()
13501350
static void SoftForkDescPushBack(const CBlockIndex* active_chain_tip, UniValue& softforks, const Consensus::Params& params, Consensus::BuriedDeployment dep)
13511351
{
13521352
// For buried deployments.
1353-
// Buried deployments with activation height value of
1354-
// std::numeric_limits<int>::max() are disabled and thus hidden.
1353+
13551354
if (!DeploymentEnabled(params, dep)) return;
13561355

13571356
UniValue rv(UniValue::VOBJ);
@@ -1366,8 +1365,8 @@ static void SoftForkDescPushBack(const CBlockIndex* active_chain_tip, UniValue&
13661365
static void SoftForkDescPushBack(const CBlockIndex* active_chain_tip, UniValue& softforks, const Consensus::Params& consensusParams, Consensus::DeploymentPos id)
13671366
{
13681367
// For BIP9 deployments.
1369-
// Deployments that are never active are hidden.
1370-
if (consensusParams.vDeployments[id].nStartTime == Consensus::BIP9Deployment::NEVER_ACTIVE) return;
1368+
1369+
if (!DeploymentEnabled(consensusParams, id)) return;
13711370

13721371
UniValue bip9(UniValue::VOBJ);
13731372
const ThresholdState thresholdState = g_versionbitscache.State(active_chain_tip, consensusParams, id);

0 commit comments

Comments
 (0)