aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/server.h
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2016-09-22 09:46:41 +0200
committerJonas Schnelli <dev@jonasschnelli.ch>2016-10-19 14:42:08 +0200
commit69d1c25768a8649bfc7eb8e9c35b8fe9874ac9fc (patch)
tree88c4ef2720fc4e88d080c6fc480c341bf118a985 /src/rpc/server.h
parent23c32a9694e119f957c124f4501294ae7a5fd99a (diff)
downloadbitcoin-69d1c25768a8649bfc7eb8e9c35b8fe9874ac9fc.tar.xz
[RPC] Give RPC commands more information about the RPC request
Diffstat (limited to 'src/rpc/server.h')
-rw-r--r--src/rpc/server.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/rpc/server.h b/src/rpc/server.h
index 4e0aa2c6d6..d8b5097035 100644
--- a/src/rpc/server.h
+++ b/src/rpc/server.h
@@ -41,14 +41,16 @@ struct UniValueType {
UniValue::VType type;
};
-class JSONRequest
+class JSONRPCRequest
{
public:
UniValue id;
std::string strMethod;
UniValue params;
+ bool fHelp;
+ std::string URI;
- JSONRequest() { id = NullUniValue; }
+ JSONRPCRequest() { id = NullUniValue; }
void parse(const UniValue& valRequest);
};
@@ -122,7 +124,7 @@ void RPCUnsetTimerInterface(RPCTimerInterface *iface);
*/
void RPCRunLater(const std::string& name, boost::function<void(void)> func, int64_t nSeconds);
-typedef UniValue(*rpcfn_type)(const UniValue& params, bool fHelp);
+typedef UniValue(*rpcfn_type)(const JSONRPCRequest& jsonRequest);
class CRPCCommand
{
@@ -147,12 +149,11 @@ public:
/**
* Execute a method.
- * @param method Method to execute
- * @param params UniValue Array of arguments (JSON objects)
+ * @param request The JSONRPCRequest to execute
* @returns Result of the call.
* @throws an exception (UniValue) when an error happens.
*/
- UniValue execute(const std::string &method, const UniValue &params) const;
+ UniValue execute(const JSONRPCRequest &request) const;
/**
* Returns a list of registered commands