Skip to content

Commit 376c0c6

Browse files
committed
rpc: getdeploymentinfo: include block hash/height
1 parent a7469bc commit 376c0c6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/rpc/blockchain.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,6 +1611,8 @@ static RPCHelpMan getdeploymentinfo()
16111611
},
16121612
RPCResult{
16131613
RPCResult::Type::OBJ, "", "", {
1614+
{RPCResult::Type::STR, "hash", "requested block hash (or tip)"},
1615+
{RPCResult::Type::NUM, "height", "requested block height (or tip)"},
16141616
{RPCResult::Type::OBJ, "deployments", "", {
16151617
{RPCResult::Type::OBJ, "xxxx", "name of the deployment", RPCHelpForDeployment}
16161618
}},
@@ -1638,6 +1640,8 @@ static RPCHelpMan getdeploymentinfo()
16381640
const Consensus::Params& consensusParams = Params().GetConsensus();
16391641

16401642
UniValue deploymentinfo(UniValue::VOBJ);
1643+
deploymentinfo.pushKV("hash", tip->GetBlockHash().ToString());
1644+
deploymentinfo.pushKV("height", tip->nHeight);
16411645
deploymentinfo.pushKV("deployments", DeploymentInfo(tip, consensusParams));
16421646
return deploymentinfo;
16431647
},

test/functional/rpc_blockchain.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ def check_signalling_deploymentinfo_result(self, gdi_result, height, blockhash,
177177
assert height >= 144 and height <= 287
178178

179179
assert_equal(gdi_result, {
180+
"hash": blockhash,
181+
"height": height,
180182
"deployments": {
181183
'bip34': {'type': 'buried', 'active': True, 'height': 2},
182184
'bip66': {'type': 'buried', 'active': True, 'height': 3},

0 commit comments

Comments
 (0)