Skip to content

Commit

Permalink
rpc: doc: Fix and extend getblockstats examples
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
3 people committed Apr 18, 2020
1 parent 969ee85 commit 7099984
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1718,8 +1718,10 @@ static UniValue getblockstats(const JSONRPCRequest& request)
{RPCResult::Type::NUM, "utxo_size_inc", "The increase/decrease in size for the utxo index (not discounting op_return and similar)"},
}},
RPCExamples{
HelpExampleCli("getblockstats", "1000 '[\"minfeerate\",\"avgfeerate\"]'")
+ HelpExampleRpc("getblockstats", "1000 '[\"minfeerate\",\"avgfeerate\"]'")
HelpExampleCli("getblockstats", R"('"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"' '["minfeerate","avgfeerate"]')") +
HelpExampleCli("getblockstats", R"(1000 '["minfeerate","avgfeerate"]')") +
HelpExampleRpc("getblockstats", R"("00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09", ["minfeerate","avgfeerate"])") +
HelpExampleRpc("getblockstats", R"(1000, ["minfeerate","avgfeerate"])")
},
}.Check(request);

Expand Down

0 comments on commit 7099984

Please sign in to comment.