Skip to content

Commit

Permalink
Add RPC help for getblock verbosity level 3
Browse files Browse the repository at this point in the history
  • Loading branch information
kiminuo committed Nov 30, 2021
1 parent 1bdd5f6 commit 059f88b
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion src/rpc/blockchain.cpp
Expand Up @@ -943,7 +943,7 @@ static RPCHelpMan getblock()
"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",
{
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
{"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"},
{"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"},
},
{
RPCResult{"for verbosity = 0",
Expand Down Expand Up @@ -985,6 +985,37 @@ static RPCHelpMan getblock()
}},
}},
}},
RPCResult{"for verbosity = 3",
RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::ELISION, "", "Same output as verbosity = 2"},
{RPCResult::Type::ARR, "tx", "",
{
{RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::ARR, "vin", "",
{
{RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::ELISION, "", "The same output as verbosity = 2"},
{RPCResult::Type::OBJ, "prevout", "(Only if undo information is available)",
{
{RPCResult::Type::BOOL, "generated", "Coinbase or not"},
{RPCResult::Type::NUM, "height", "The height of the prevout"},
{RPCResult::Type::NUM, "value", "The value in " + CURRENCY_UNIT},
{RPCResult::Type::OBJ, "scriptPubKey", "",
{
{RPCResult::Type::STR, "asm", "The asm"},
{RPCResult::Type::STR, "hex", "The hex"},
{RPCResult::Type::STR, "address", /* optional */ true, "The Bitcoin address (only if a well-defined address exists)"},
{RPCResult::Type::STR, "type", "The type, eg 'pubkeyhash'"},
}},
}},
}},
}},
}},
}},
}},
},
RPCExamples{
HelpExampleCli("getblock", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"")
Expand Down

0 comments on commit 059f88b

Please sign in to comment.