From 485beee975a0d15854642888165a490b93912ea0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Me=C5=A1=C5=A5an?= Date: Thu, 29 Apr 2021 15:07:10 +0200 Subject: [PATCH] verbose parameter for getblock as integer possibility to send verbose parameter in getblock method as integer (like in bitcoin RPC) --- src/rpcblockchain.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 9b97fdfc..2eca5431 100755 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -387,9 +387,14 @@ UniValue getblock(const UniValue& params, bool fHelp) uint256 hash(strHash); bool fVerbose = true; - if (params.size() > 1) - fVerbose = params[1].get_bool(); - + if (params.size() > 1) { + if(params[1].isBool()) { + fVerbose = params[1].get_bool(); + } else { + fVerbose = params[1].get_int() ? true : false; + } + } + if (mapBlockIndex.count(hash) == 0) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");