aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rpcclient.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp
index 8b7b9e1493..bedf9ffbcb 100644
--- a/src/rpcclient.cpp
+++ b/src/rpcclient.cpp
@@ -11,6 +11,8 @@
#include <set>
#include <stdint.h>
+#include <boost/algorithm/string/case_conv.hpp> // for to_lower()
+
using namespace std;
using namespace json_spirit;
@@ -134,9 +136,19 @@ Array RPCConvertValues(const std::string &strMethod, const std::vector<std::stri
// parse string as JSON, insert bool/number/object/etc. value
else {
+ //according to rfc4627 null, true, false are not valid json strings
Value jVal;
- if (!jVal.read(strVal))
- throw runtime_error(string("Error parsing JSON:")+strVal);
+ if(strVal == "null")
+ jVal.setNull();
+ else if(strVal == "true")
+ jVal.setBool(true);
+ else if(strVal == "false")
+ jVal.setBool(false);
+ else
+ {
+ if (!jVal.read(strVal))
+ throw runtime_error(string("Error parsing JSON:")+strVal);
+ }
params.push_back(jVal);
}
}