aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorklementtan <klement.tan@ninjavan.co>2021-04-17 19:08:47 +0800
committerklementtan <klement.tan@ninjavan.co>2021-04-18 12:30:58 +0800
commita41149426168b8ea96099f10576022c6a09033d1 (patch)
treeff652240d9992f138c94afad7af40ffe65f84fc9 /src/rpc
parentf5e8bcf985df212c901b1e3e1ed0b68933c321f6 (diff)
downloadbitcoin-a41149426168b8ea96099f10576022c6a09033d1.tar.xz
rpc: Improve getblock error message for invalid data type.
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/blockchain.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp
index f27e9af0d9..d88e75891d 100644
--- a/src/rpc/blockchain.cpp
+++ b/src/rpc/blockchain.cpp
@@ -936,10 +936,11 @@ static RPCHelpMan getblock()
int verbosity = 1;
if (!request.params[1].isNull()) {
- if(request.params[1].isNum())
- verbosity = request.params[1].get_int();
- else
+ if (request.params[1].isBool()) {
verbosity = request.params[1].get_bool() ? 1 : 0;
+ } else {
+ verbosity = request.params[1].get_int();
+ }
}
CBlock block;