aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/blockchain.cpp
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2021-11-14 08:44:40 +1000
committerAnthony Towns <aj@erisian.com.au>2022-01-15 04:37:56 +1000
commit376c0c6dae2bebbb3e1352377e71fb1996d09f64 (patch)
tree7c883d84318aa9eeb18fc13b12d1394fc7470ba5 /src/rpc/blockchain.cpp
parenta7469bcd35692d56f57e91b3f21d30855bdf6531 (diff)
downloadbitcoin-376c0c6dae2bebbb3e1352377e71fb1996d09f64.tar.xz
rpc: getdeploymentinfo: include block hash/height
Diffstat (limited to 'src/rpc/blockchain.cpp')
-rw-r--r--src/rpc/blockchain.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp
index dc5c91fe8a..32cb65679e 100644
--- a/src/rpc/blockchain.cpp
+++ b/src/rpc/blockchain.cpp
@@ -1611,6 +1611,8 @@ static RPCHelpMan getdeploymentinfo()
},
RPCResult{
RPCResult::Type::OBJ, "", "", {
+ {RPCResult::Type::STR, "hash", "requested block hash (or tip)"},
+ {RPCResult::Type::NUM, "height", "requested block height (or tip)"},
{RPCResult::Type::OBJ, "deployments", "", {
{RPCResult::Type::OBJ, "xxxx", "name of the deployment", RPCHelpForDeployment}
}},
@@ -1638,6 +1640,8 @@ static RPCHelpMan getdeploymentinfo()
const Consensus::Params& consensusParams = Params().GetConsensus();
UniValue deploymentinfo(UniValue::VOBJ);
+ deploymentinfo.pushKV("hash", tip->GetBlockHash().ToString());
+ deploymentinfo.pushKV("height", tip->nHeight);
deploymentinfo.pushKV("deployments", DeploymentInfo(tip, consensusParams));
return deploymentinfo;
},