Skip to content

Commit 059f88b

Browse files
committed
Add RPC help for getblock verbosity level 3
1 parent 1bdd5f6 commit 059f88b

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

src/rpc/blockchain.cpp

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ static RPCHelpMan getblock()
943943
"If verbosity is 3, returns an Object with information about block <hash> and information about each transaction, including prevout information for inputs (only for unpruned blocks in the current best chain).\n",
944944
{
945945
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
946-
{"verbosity|verbose", RPCArg::Type::NUM, RPCArg::Default{1}, "0 for hex-encoded data, 1 for a json object, and 2 for json object with transaction data"},
946+
{"verbosity|verbose", RPCArg::Type::NUM, RPCArg::Default{1}, "0 for hex-encoded data, 1 for a JSON object, 2 for JSON object with transaction data, and 3 for JSON object with transaction data including prevout information for inputs"},
947947
},
948948
{
949949
RPCResult{"for verbosity = 0",
@@ -985,6 +985,37 @@ static RPCHelpMan getblock()
985985
}},
986986
}},
987987
}},
988+
RPCResult{"for verbosity = 3",
989+
RPCResult::Type::OBJ, "", "",
990+
{
991+
{RPCResult::Type::ELISION, "", "Same output as verbosity = 2"},
992+
{RPCResult::Type::ARR, "tx", "",
993+
{
994+
{RPCResult::Type::OBJ, "", "",
995+
{
996+
{RPCResult::Type::ARR, "vin", "",
997+
{
998+
{RPCResult::Type::OBJ, "", "",
999+
{
1000+
{RPCResult::Type::ELISION, "", "The same output as verbosity = 2"},
1001+
{RPCResult::Type::OBJ, "prevout", "(Only if undo information is available)",
1002+
{
1003+
{RPCResult::Type::BOOL, "generated", "Coinbase or not"},
1004+
{RPCResult::Type::NUM, "height", "The height of the prevout"},
1005+
{RPCResult::Type::NUM, "value", "The value in " + CURRENCY_UNIT},
1006+
{RPCResult::Type::OBJ, "scriptPubKey", "",
1007+
{
1008+
{RPCResult::Type::STR, "asm", "The asm"},
1009+
{RPCResult::Type::STR, "hex", "The hex"},
1010+
{RPCResult::Type::STR, "address", /* optional */ true, "The Bitcoin address (only if a well-defined address exists)"},
1011+
{RPCResult::Type::STR, "type", "The type, eg 'pubkeyhash'"},
1012+
}},
1013+
}},
1014+
}},
1015+
}},
1016+
}},
1017+
}},
1018+
}},
9881019
},
9891020
RPCExamples{
9901021
HelpExampleCli("getblock", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"")

0 commit comments

Comments
 (0)