aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpc/client.cpp')
-rw-r--r--src/rpc/client.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/rpc/client.cpp b/src/rpc/client.cpp
index 5fe914f0a1..a94c7e8c29 100644
--- a/src/rpc/client.cpp
+++ b/src/rpc/client.cpp
@@ -253,13 +253,11 @@ static CRPCConvertTable rpcCvtTable;
/** Non-RFC4627 JSON parser, accepts internal values (such as numbers, true, false, null)
* as well as objects and arrays.
*/
-UniValue ParseNonRFCJSONValue(const std::string& strVal)
+UniValue ParseNonRFCJSONValue(const std::string& raw)
{
- UniValue jVal;
- if (!jVal.read(std::string("[")+strVal+std::string("]")) ||
- !jVal.isArray() || jVal.size()!=1)
- throw std::runtime_error(std::string("Error parsing JSON: ") + strVal);
- return jVal[0];
+ UniValue parsed;
+ if (!parsed.read(raw)) throw std::runtime_error(std::string("Error parsing JSON: ") + raw);
+ return parsed;
}
UniValue RPCConvertValues(const std::string &strMethod, const std::vector<std::string> &strParams)