Skip to content

Commit faa2059

Browse files
author
MarcoFalke
committed
rpc: Properly document gettxout return value
Can be reviewed with --ignore-all-space
1 parent 56f06a9 commit faa2059

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

src/rpc/blockchain.cpp

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,30 +1100,29 @@ static RPCHelpMan gettxoutsetinfo()
11001100
static RPCHelpMan gettxout()
11011101
{
11021102
return RPCHelpMan{"gettxout",
1103-
"\nReturns details about an unspent transaction output.\n",
1104-
{
1105-
{"txid", RPCArg::Type::STR, RPCArg::Optional::NO, "The transaction id"},
1106-
{"n", RPCArg::Type::NUM, RPCArg::Optional::NO, "vout number"},
1107-
{"include_mempool", RPCArg::Type::BOOL, /* default */ "true", "Whether to include the mempool. Note that an unspent output that is spent in the mempool won't appear."},
1108-
},
1109-
RPCResult{
1110-
RPCResult::Type::OBJ, "", "",
1111-
{
1112-
{RPCResult::Type::STR_HEX, "bestblock", "The hash of the block at the tip of the chain"},
1113-
{RPCResult::Type::NUM, "confirmations", "The number of confirmations"},
1114-
{RPCResult::Type::STR_AMOUNT, "value", "The transaction value in " + CURRENCY_UNIT},
1115-
{RPCResult::Type::OBJ, "scriptPubKey", "",
1116-
{
1117-
{RPCResult::Type::STR_HEX, "asm", ""},
1118-
{RPCResult::Type::STR_HEX, "hex", ""},
1119-
{RPCResult::Type::NUM, "reqSigs", "Number of required signatures"},
1120-
{RPCResult::Type::STR_HEX, "type", "The type, eg pubkeyhash"},
1121-
{RPCResult::Type::ARR, "addresses", "array of bitcoin addresses",
1122-
{{RPCResult::Type::STR, "address", "bitcoin address"}}},
1123-
}},
1124-
{RPCResult::Type::BOOL, "coinbase", "Coinbase or not"},
1125-
}},
1126-
RPCExamples{
1103+
"\nReturns details about an unspent transaction output.\n",
1104+
{
1105+
{"txid", RPCArg::Type::STR, RPCArg::Optional::NO, "The transaction id"},
1106+
{"n", RPCArg::Type::NUM, RPCArg::Optional::NO, "vout number"},
1107+
{"include_mempool", RPCArg::Type::BOOL, /* default */ "true", "Whether to include the mempool. Note that an unspent output that is spent in the mempool won't appear."},
1108+
},
1109+
{
1110+
RPCResult{"If the UTXO was not found", RPCResult::Type::NONE, "", ""},
1111+
RPCResult{"Otherwise", RPCResult::Type::OBJ, "", "", {
1112+
{RPCResult::Type::STR_HEX, "bestblock", "The hash of the block at the tip of the chain"},
1113+
{RPCResult::Type::NUM, "confirmations", "The number of confirmations"},
1114+
{RPCResult::Type::STR_AMOUNT, "value", "The transaction value in " + CURRENCY_UNIT},
1115+
{RPCResult::Type::OBJ, "scriptPubKey", "", {
1116+
{RPCResult::Type::STR_HEX, "asm", ""},
1117+
{RPCResult::Type::STR_HEX, "hex", ""},
1118+
{RPCResult::Type::NUM, "reqSigs", "Number of required signatures"},
1119+
{RPCResult::Type::STR_HEX, "type", "The type, eg pubkeyhash"},
1120+
{RPCResult::Type::ARR, "addresses", "array of bitcoin addresses", {{RPCResult::Type::STR, "address", "bitcoin address"}}},
1121+
}},
1122+
{RPCResult::Type::BOOL, "coinbase", "Coinbase or not"},
1123+
}},
1124+
},
1125+
RPCExamples{
11271126
"\nGet unspent transactions\n"
11281127
+ HelpExampleCli("listunspent", "") +
11291128
"\nView the details\n"

0 commit comments

Comments
 (0)