diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index cfc0379f683..ddaa4eadbec 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1453,6 +1453,9 @@ RPCHelpMan getdeploymentinfo() RPCResult::Type::OBJ, "", "", { {RPCResult::Type::STR, "hash", "requested block hash (or tip)"}, {RPCResult::Type::NUM, "height", "requested block height (or tip)"}, + {RPCResult::Type::ARR, "script_flags", "script verify flags for the block", { + {RPCResult::Type::STR, "flag", "a script verify flag"}, + }}, {RPCResult::Type::OBJ_DYN, "deployments", "", { {RPCResult::Type::OBJ, "xxxx", "name of the deployment", RPCHelpForDeployment} }}, @@ -1479,6 +1482,12 @@ RPCHelpMan getdeploymentinfo() UniValue deploymentinfo(UniValue::VOBJ); deploymentinfo.pushKV("hash", blockindex->GetBlockHash().ToString()); deploymentinfo.pushKV("height", blockindex->nHeight); + { + const auto flagnames = GetScriptFlagNames(GetBlockScriptFlags(*blockindex, chainman)); + UniValue uv_flagnames(UniValue::VARR); + uv_flagnames.push_backV(flagnames.begin(), flagnames.end()); + deploymentinfo.pushKV("script_flags", uv_flagnames); + } deploymentinfo.pushKV("deployments", DeploymentInfo(blockindex, chainman)); return deploymentinfo; }, diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py index 84fa8ebccf1..3c011c09ed0 100755 --- a/test/functional/rpc_blockchain.py +++ b/test/functional/rpc_blockchain.py @@ -213,6 +213,7 @@ class BlockchainTest(BitcoinTestFramework): assert_equal(gdi_result, { "hash": blockhash, "height": height, + "script_flags": ["CHECKLOCKTIMEVERIFY","CHECKSEQUENCEVERIFY","DERSIG","NULLDUMMY","P2SH","TAPROOT","WITNESS"], "deployments": { 'bip34': {'type': 'buried', 'active': True, 'height': 2}, 'bip66': {'type': 'buried', 'active': True, 'height': 3},