@@ -1430,7 +1430,7 @@ static RPCHelpMan verifychain()
1430
1430
};
1431
1431
}
1432
1432
1433
- static void SoftForkDescPushBack (const CBlockIndex* active_chain_tip , UniValue& softforks, const Consensus::Params& params, Consensus::BuriedDeployment dep)
1433
+ static void SoftForkDescPushBack (const CBlockIndex* blockindex , UniValue& softforks, const Consensus::Params& params, Consensus::BuriedDeployment dep)
1434
1434
{
1435
1435
// For buried deployments.
1436
1436
@@ -1440,17 +1440,17 @@ static void SoftForkDescPushBack(const CBlockIndex* active_chain_tip, UniValue&
1440
1440
rv.pushKV (" type" , " buried" );
1441
1441
// getdeploymentinfo reports the softfork as active from when the chain height is
1442
1442
// one below the activation height
1443
- rv.pushKV (" active" , DeploymentActiveAfter (active_chain_tip , params, dep));
1443
+ rv.pushKV (" active" , DeploymentActiveAfter (blockindex , params, dep));
1444
1444
rv.pushKV (" height" , params.DeploymentHeight (dep));
1445
1445
softforks.pushKV (DeploymentName (dep), rv);
1446
1446
}
1447
1447
1448
- static void SoftForkDescPushBack (const CBlockIndex* active_chain_tip , UniValue& softforks, const Consensus::Params& consensusParams, Consensus::DeploymentPos id)
1448
+ static void SoftForkDescPushBack (const CBlockIndex* blockindex , UniValue& softforks, const Consensus::Params& consensusParams, Consensus::DeploymentPos id)
1449
1449
{
1450
1450
// For BIP9 deployments.
1451
1451
1452
1452
if (!DeploymentEnabled (consensusParams, id)) return ;
1453
- if (active_chain_tip == nullptr ) return ;
1453
+ if (blockindex == nullptr ) return ;
1454
1454
1455
1455
auto get_state_name = [](const ThresholdState state) -> std::string {
1456
1456
switch (state) {
@@ -1465,8 +1465,8 @@ static void SoftForkDescPushBack(const CBlockIndex* active_chain_tip, UniValue&
1465
1465
1466
1466
UniValue bip9 (UniValue::VOBJ);
1467
1467
1468
- const ThresholdState next_state = g_versionbitscache.State (active_chain_tip , consensusParams, id);
1469
- const ThresholdState current_state = g_versionbitscache.State (active_chain_tip ->pprev , consensusParams, id);
1468
+ const ThresholdState next_state = g_versionbitscache.State (blockindex , consensusParams, id);
1469
+ const ThresholdState current_state = g_versionbitscache.State (blockindex ->pprev , consensusParams, id);
1470
1470
1471
1471
const bool has_signal = (ThresholdState::STARTED == current_state || ThresholdState::LOCKED_IN == current_state);
1472
1472
@@ -1480,14 +1480,14 @@ static void SoftForkDescPushBack(const CBlockIndex* active_chain_tip, UniValue&
1480
1480
1481
1481
// BIP9 status
1482
1482
bip9.pushKV (" status" , get_state_name (current_state));
1483
- bip9.pushKV (" since" , g_versionbitscache.StateSinceHeight (active_chain_tip ->pprev , consensusParams, id));
1483
+ bip9.pushKV (" since" , g_versionbitscache.StateSinceHeight (blockindex ->pprev , consensusParams, id));
1484
1484
bip9.pushKV (" status-next" , get_state_name (next_state));
1485
1485
1486
1486
// BIP9 signalling status, if applicable
1487
1487
if (has_signal) {
1488
1488
UniValue statsUV (UniValue::VOBJ);
1489
1489
std::vector<bool > signals;
1490
- BIP9Stats statsStruct = g_versionbitscache.Statistics (active_chain_tip , consensusParams, id, &signals);
1490
+ BIP9Stats statsStruct = g_versionbitscache.Statistics (blockindex , consensusParams, id, &signals);
1491
1491
statsUV.pushKV (" period" , statsStruct.period );
1492
1492
statsUV.pushKV (" elapsed" , statsStruct.elapsed );
1493
1493
statsUV.pushKV (" count" , statsStruct.count );
@@ -1508,7 +1508,7 @@ static void SoftForkDescPushBack(const CBlockIndex* active_chain_tip, UniValue&
1508
1508
UniValue rv (UniValue::VOBJ);
1509
1509
rv.pushKV (" type" , " bip9" );
1510
1510
if (ThresholdState::ACTIVE == next_state) {
1511
- rv.pushKV (" height" , g_versionbitscache.StateSinceHeight (active_chain_tip , consensusParams, id));
1511
+ rv.pushKV (" height" , g_versionbitscache.StateSinceHeight (blockindex , consensusParams, id));
1512
1512
}
1513
1513
rv.pushKV (" active" , ThresholdState::ACTIVE == next_state);
1514
1514
rv.pushKV (" bip9" , bip9);
@@ -1517,7 +1517,7 @@ static void SoftForkDescPushBack(const CBlockIndex* active_chain_tip, UniValue&
1517
1517
}
1518
1518
1519
1519
namespace {
1520
- /* TODO: when -dprecatedrpc =softforks is removed, drop these */
1520
+ /* TODO: when -deprecatedrpc =softforks is removed, drop these */
1521
1521
UniValue DeploymentInfo (const CBlockIndex* tip, const Consensus::Params& consensusParams);
1522
1522
extern const std::vector<RPCResult> RPCHelpForDeployment;
1523
1523
}
@@ -1621,9 +1621,9 @@ const std::vector<RPCResult> RPCHelpForDeployment{
1621
1621
{RPCResult::Type::NUM_TIME, " start_time" , " the minimum median time past of a block at which the bit gains its meaning" },
1622
1622
{RPCResult::Type::NUM_TIME, " timeout" , " the median time past of a block at which the deployment is considered failed if not yet locked in" },
1623
1623
{RPCResult::Type::NUM, " min_activation_height" , " minimum height of blocks for which the rules may be enforced" },
1624
- {RPCResult::Type::STR, " status" , " bip9 status of specified block (one of \" defined\" , \" started\" , \" locked_in\" , \" active\" , \" failed\" )" },
1624
+ {RPCResult::Type::STR, " status" , " status of deployment at specified block (one of \" defined\" , \" started\" , \" locked_in\" , \" active\" , \" failed\" )" },
1625
1625
{RPCResult::Type::NUM, " since" , " height of the first block to which the status applies" },
1626
- {RPCResult::Type::STR, " status-next" , " bip9 status of next block" },
1626
+ {RPCResult::Type::STR, " status-next" , " status of deployment at the next block" },
1627
1627
{RPCResult::Type::OBJ, " statistics" , /* optional=*/ true , " numeric statistics about signalling for a softfork (only for \" started\" and \" locked_in\" status)" ,
1628
1628
{
1629
1629
{RPCResult::Type::NUM, " period" , " the length in blocks of the signalling period" },
@@ -1636,26 +1636,26 @@ const std::vector<RPCResult> RPCHelpForDeployment{
1636
1636
}},
1637
1637
};
1638
1638
1639
- UniValue DeploymentInfo (const CBlockIndex* tip , const Consensus::Params& consensusParams)
1639
+ UniValue DeploymentInfo (const CBlockIndex* blockindex , const Consensus::Params& consensusParams)
1640
1640
{
1641
1641
UniValue softforks (UniValue::VOBJ);
1642
- SoftForkDescPushBack (tip , softforks, consensusParams, Consensus::DEPLOYMENT_HEIGHTINCB);
1643
- SoftForkDescPushBack (tip , softforks, consensusParams, Consensus::DEPLOYMENT_DERSIG);
1644
- SoftForkDescPushBack (tip , softforks, consensusParams, Consensus::DEPLOYMENT_CLTV);
1645
- SoftForkDescPushBack (tip , softforks, consensusParams, Consensus::DEPLOYMENT_CSV);
1646
- SoftForkDescPushBack (tip , softforks, consensusParams, Consensus::DEPLOYMENT_SEGWIT);
1647
- SoftForkDescPushBack (tip , softforks, consensusParams, Consensus::DEPLOYMENT_TESTDUMMY);
1648
- SoftForkDescPushBack (tip , softforks, consensusParams, Consensus::DEPLOYMENT_TAPROOT);
1642
+ SoftForkDescPushBack (blockindex , softforks, consensusParams, Consensus::DEPLOYMENT_HEIGHTINCB);
1643
+ SoftForkDescPushBack (blockindex , softforks, consensusParams, Consensus::DEPLOYMENT_DERSIG);
1644
+ SoftForkDescPushBack (blockindex , softforks, consensusParams, Consensus::DEPLOYMENT_CLTV);
1645
+ SoftForkDescPushBack (blockindex , softforks, consensusParams, Consensus::DEPLOYMENT_CSV);
1646
+ SoftForkDescPushBack (blockindex , softforks, consensusParams, Consensus::DEPLOYMENT_SEGWIT);
1647
+ SoftForkDescPushBack (blockindex , softforks, consensusParams, Consensus::DEPLOYMENT_TESTDUMMY);
1648
+ SoftForkDescPushBack (blockindex , softforks, consensusParams, Consensus::DEPLOYMENT_TAPROOT);
1649
1649
return softforks;
1650
1650
}
1651
1651
} // anon namespace
1652
1652
1653
1653
static RPCHelpMan getdeploymentinfo ()
1654
1654
{
1655
1655
return RPCHelpMan{" getdeploymentinfo" ,
1656
- " Returns an object containing various state info regarding soft-forks ." ,
1656
+ " Returns an object containing various state info regarding deployments of consensus changes ." ,
1657
1657
{
1658
- {" blockhash" , RPCArg::Type::STR_HEX, RPCArg::Default{" chain tip" }, " The block hash at which to query fork state" },
1658
+ {" blockhash" , RPCArg::Type::STR_HEX, RPCArg::Default{" hash of current chain tip" }, " The block hash at which to query deployment state" },
1659
1659
},
1660
1660
RPCResult{
1661
1661
RPCResult::Type::OBJ, " " , " " , {
@@ -1669,28 +1669,28 @@ static RPCHelpMan getdeploymentinfo()
1669
1669
RPCExamples{ HelpExampleCli (" getdeploymentinfo" , " " ) + HelpExampleRpc (" getdeploymentinfo" , " " ) },
1670
1670
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
1671
1671
{
1672
- ChainstateManager& chainman = EnsureAnyChainman (request.context );
1672
+ const ChainstateManager& chainman = EnsureAnyChainman (request.context );
1673
1673
LOCK (cs_main);
1674
- CChainState& active_chainstate = chainman.ActiveChainstate ();
1674
+ const CChainState& active_chainstate = chainman.ActiveChainstate ();
1675
1675
1676
- const CBlockIndex* tip ;
1676
+ const CBlockIndex* blockindex ;
1677
1677
if (request.params [0 ].isNull ()) {
1678
- tip = active_chainstate.m_chain .Tip ();
1679
- CHECK_NONFATAL (tip );
1678
+ blockindex = active_chainstate.m_chain .Tip ();
1679
+ CHECK_NONFATAL (blockindex );
1680
1680
} else {
1681
- uint256 hash (ParseHashV (request.params [0 ], " blockhash" ));
1682
- tip = chainman.m_blockman .LookupBlockIndex (hash);
1683
- if (!tip ) {
1681
+ const uint256 hash (ParseHashV (request.params [0 ], " blockhash" ));
1682
+ blockindex = chainman.m_blockman .LookupBlockIndex (hash);
1683
+ if (!blockindex ) {
1684
1684
throw JSONRPCError (RPC_INVALID_ADDRESS_OR_KEY, " Block not found" );
1685
1685
}
1686
1686
}
1687
1687
1688
1688
const Consensus::Params& consensusParams = Params ().GetConsensus ();
1689
1689
1690
1690
UniValue deploymentinfo (UniValue::VOBJ);
1691
- deploymentinfo.pushKV (" hash" , tip ->GetBlockHash ().ToString ());
1692
- deploymentinfo.pushKV (" height" , tip ->nHeight );
1693
- deploymentinfo.pushKV (" deployments" , DeploymentInfo (tip , consensusParams));
1691
+ deploymentinfo.pushKV (" hash" , blockindex ->GetBlockHash ().ToString ());
1692
+ deploymentinfo.pushKV (" height" , blockindex ->nHeight );
1693
+ deploymentinfo.pushKV (" deployments" , DeploymentInfo (blockindex , consensusParams));
1694
1694
return deploymentinfo;
1695
1695
},
1696
1696
};
0 commit comments