aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2019-12-29 23:16:48 -0800
committerAdam Soltys <[email protected]>2020-04-17 20:40:08 -0700
commit709998467e1c1bc7980662c9f88fbc7964602d33 (patch)
tree33bafc325a8258559658023b3add2458c50134e8
parentMerge #18662: test: Replace gArgs with local argsman in bench (diff)
downloaddiscoin-709998467e1c1bc7980662c9f88fbc7964602d33.tar.xz
discoin-709998467e1c1bc7980662c9f88fbc7964602d33.zip
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]>
-rw-r--r--src/rpc/blockchain.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp
index 279fcc36e..90a68c93d 100644
--- a/src/rpc/blockchain.cpp
+++ b/src/rpc/blockchain.cpp
@@ -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);