Skip to content

Commit 7099984

Browse files
asoltysandrewtoththeStack
committed
rpc: doc: Fix and extend getblockstats examples
This fixes the example curl command for `getblockstats` which is missing a comma between the params and has single quotes around the second parameter. Besides fixing the existing example, this commit adds an additional example of getting block stats by hash by using a known workaround with bitcoin-cli to get it to treat the hash parameter as a JSON string by wrapping it in both single and double quotes. Co-Authored-By: Andrew Toth <[email protected]> Co-Authored-By: Sebastian Falbesoner <[email protected]>
1 parent 969ee85 commit 7099984

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/rpc/blockchain.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,8 +1718,10 @@ static UniValue getblockstats(const JSONRPCRequest& request)
17181718
{RPCResult::Type::NUM, "utxo_size_inc", "The increase/decrease in size for the utxo index (not discounting op_return and similar)"},
17191719
}},
17201720
RPCExamples{
1721-
HelpExampleCli("getblockstats", "1000 '[\"minfeerate\",\"avgfeerate\"]'")
1722-
+ HelpExampleRpc("getblockstats", "1000 '[\"minfeerate\",\"avgfeerate\"]'")
1721+
HelpExampleCli("getblockstats", R"('"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"' '["minfeerate","avgfeerate"]')") +
1722+
HelpExampleCli("getblockstats", R"(1000 '["minfeerate","avgfeerate"]')") +
1723+
HelpExampleRpc("getblockstats", R"("00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09", ["minfeerate","avgfeerate"])") +
1724+
HelpExampleRpc("getblockstats", R"(1000, ["minfeerate","avgfeerate"])")
17231725
},
17241726
}.Check(request);
17251727

0 commit comments

Comments
 (0)