mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
[rpc] Fix fVerbose parsing (remove excess if cases).
This commit is contained in:
committed by
Karl-Johan Alm
parent
26efc220a1
commit
a5f5a2ce53
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user