diff options
author | fanquake <fanquake@gmail.com> | 2021-04-19 14:15:30 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2021-04-19 14:16:19 +0800 |
commit | a47ae618a00ca06075caac6dfb1860480086d044 (patch) | |
tree | d1ee6ed838544cb2da7e57ea7cecaf496d670057 /src/rpc | |
parent | 0dd7b234895b02bfc512ae83bd77b581c861d6e9 (diff) | |
parent | a41149426168b8ea96099f10576022c6a09033d1 (diff) |
Merge #21718: rpc: Improve error message for getblock invalid datatype.
a41149426168b8ea96099f10576022c6a09033d1 rpc: Improve getblock error message for invalid data type. (klementtan)
Pull request description:
Improve error messages for getblock invalid datatype.
fixes: #21717
ACKs for top commit:
instagibbs:
utACK https://github.com/bitcoin/bitcoin/pull/21718/commits/a41149426168b8ea96099f10576022c6a09033d1
theStack:
ACK a41149426168b8ea96099f10576022c6a09033d1
promag:
Code review ACK a41149426168b8ea96099f10576022c6a09033d1.
Tree-SHA512: 6e7d8290681e8ab375629f81669d0f8e0c21f9eb7ed9e2455cd19ea013e69b2d95fa7a9ee795315b2d5c60c96035c6cefc3d6e1039a06fd88c1dc7fe275ee6a1
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/blockchain.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 7cf6a413e1..833882ae3f 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -955,10 +955,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; |