mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
rpc: identify JSON-RPC 2.0 requests
This commit is contained in:
@@ -11,6 +11,11 @@
|
||||
|
||||
#include <univalue.h>
|
||||
|
||||
enum class JSONRPCVersion {
|
||||
V1_LEGACY,
|
||||
V2
|
||||
};
|
||||
|
||||
UniValue JSONRPCRequestObj(const std::string& strMethod, const UniValue& params, const UniValue& id);
|
||||
UniValue JSONRPCReplyObj(UniValue result, UniValue error, UniValue id);
|
||||
UniValue JSONRPCError(int code, const std::string& message);
|
||||
@@ -35,6 +40,7 @@ public:
|
||||
std::string authUser;
|
||||
std::string peerAddr;
|
||||
std::any context;
|
||||
JSONRPCVersion m_json_version = JSONRPCVersion::V1_LEGACY;
|
||||
|
||||
void parse(const UniValue& valRequest);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user