diff options
author | Karl-Johan Alm <kalle.alm@gmail.com> | 2017-05-06 12:49:18 +0900 |
---|---|---|
committer | Karl-Johan Alm <karljohan-alm@garage.co.jp> | 2017-11-29 17:52:13 +0900 |
commit | a5f5a2ce53622b8d2e3fda659e497d47c5d164b0 (patch) | |
tree | da51794016e95247fe7fd8611cb595aa30b92835 /src/rpc | |
parent | 26efc220a13aa3413f6e55e311e8991445104f82 (diff) |
[rpc] Fix fVerbose parsing (remove excess if cases).
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/rawtransaction.cpp | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 3aff1e9fbf..5d558d8bf9 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -141,19 +141,7 @@ UniValue getrawtransaction(const JSONRPCRequest& request) // Accept either a bool (true) or a num (>=1) to indicate verbose output. bool fVerbose = false; if (!request.params[1].isNull()) { - if (request.params[1].isNum()) { - if (request.params[1].get_int() != 0) { - fVerbose = true; - } - } - else if(request.params[1].isBool()) { - if(request.params[1].isTrue()) { - fVerbose = true; - } - } - else { - throw JSONRPCError(RPC_TYPE_ERROR, "Invalid type provided. Verbose parameter must be a boolean."); - } + fVerbose = request.params[1].isNum() ? (request.params[1].get_int() != 0) : request.params[1].get_bool(); } CTransactionRef tx; |