Skip to content

Commit 1ed5681

Browse files
committed
rpc: add missing scantxoutset examples
1 parent 383d350 commit 1ed5681

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/rpc/blockchain.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2296,6 +2296,9 @@ class CoinsViewScanReserver
22962296

22972297
static RPCHelpMan scantxoutset()
22982298
{
2299+
// scriptPubKey corresponding to mainnet address 12cbQLTFMXRnSzktFkuoG3eHoMeFtpTu3S
2300+
const std::string EXAMPLE_DESCRIPTOR_RAW = "raw(76a91411b366edfc0a8b66feebae5c2e25a7b6a5d1cf3188ac)#fm24fxxy";
2301+
22992302
return RPCHelpMan{"scantxoutset",
23002303
"\nScans the unspent transaction output set for entries that match certain output descriptors.\n"
23012304
"Examples of output descriptors are:\n"
@@ -2353,7 +2356,14 @@ static RPCHelpMan scantxoutset()
23532356
{RPCResult::Type::STR_AMOUNT, "total_amount", "The total amount of all found unspent outputs in " + CURRENCY_UNIT},
23542357
}},
23552358
},
2356-
RPCExamples{""},
2359+
RPCExamples{
2360+
HelpExampleCli("scantxoutset", "start \'[\"" + EXAMPLE_DESCRIPTOR_RAW + "\"]\'") +
2361+
HelpExampleCli("scantxoutset", "status") +
2362+
HelpExampleCli("scantxoutset", "abort") +
2363+
HelpExampleRpc("scantxoutset", "\"start\", [\"" + EXAMPLE_DESCRIPTOR_RAW + "\"]") +
2364+
HelpExampleRpc("scantxoutset", "\"status\"") +
2365+
HelpExampleRpc("scantxoutset", "\"abort\"")
2366+
},
23572367
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
23582368
{
23592369
RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VARR});

0 commit comments

Comments
 (0)