mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 06:43:45 +01:00
Convert tree to using univalue. Eliminate all json_spirit uses.
This commit is contained in:
committed by
Jonas Schnelli
parent
5e3060c0d1
commit
15982a8b69
@@ -23,7 +23,7 @@
|
||||
#include <boost/iostreams/concepts.hpp>
|
||||
#include <boost/iostreams/stream.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include "json/json_spirit_writer_template.h"
|
||||
#include "json_spirit_wrapper.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace json_spirit;
|
||||
@@ -260,14 +260,14 @@ string JSONRPCRequest(const string& strMethod, const Array& params, const Value&
|
||||
request.push_back(Pair("method", strMethod));
|
||||
request.push_back(Pair("params", params));
|
||||
request.push_back(Pair("id", id));
|
||||
return write_string(Value(request), false) + "\n";
|
||||
return request.write() + "\n";
|
||||
}
|
||||
|
||||
Object JSONRPCReplyObj(const Value& result, const Value& error, const Value& id)
|
||||
{
|
||||
Object reply;
|
||||
if (error.type() != null_type)
|
||||
reply.push_back(Pair("result", Value::null));
|
||||
if (!error.isNull())
|
||||
reply.push_back(Pair("result", NullUniValue));
|
||||
else
|
||||
reply.push_back(Pair("result", result));
|
||||
reply.push_back(Pair("error", error));
|
||||
@@ -278,7 +278,7 @@ Object JSONRPCReplyObj(const Value& result, const Value& error, const Value& id)
|
||||
string JSONRPCReply(const Value& result, const Value& error, const Value& id)
|
||||
{
|
||||
Object reply = JSONRPCReplyObj(result, error, id);
|
||||
return write_string(Value(reply), false) + "\n";
|
||||
return reply.write() + "\n";
|
||||
}
|
||||
|
||||
Object JSONRPCError(int code, const string& message)
|
||||
|
||||
Reference in New Issue
Block a user