aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/net.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-01-10 13:52:49 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2017-01-10 14:14:50 +0100
commit5754e0341b7c033d4caf99534aca47e9981bd7ed (patch)
tree9d64b4fc97f929fee1b7037a202eb7ee79db0f87 /src/rpc/net.cpp
parent68eb56203be17066af4e37837703490af4d4f40c (diff)
parent4e7e2e16e4530be31bfc696a08bd3d1265e6f235 (diff)
Merge #8811: rpc: Add support for JSON-RPC named arguments
4e7e2e1 Update RPC argument names (John Newbery) 481f289 rpc: Named argument support for bitcoin-cli (Wladimir J. van der Laan) 9adb4e1 rpc: Argument name consistency (Wladimir J. van der Laan) 8d713f7 rpc: Named arguments for rawtransaction calls (Wladimir J. van der Laan) 37a166f rpc: Named arguments for wallet calls (Wladimir J. van der Laan) 78b684f rpc: Named arguments for mining calls (Wladimir J. van der Laan) b8ebc59 rpc: Named arguments for net calls (Wladimir J. van der Laan) 2ca9dcd test: Add test for RPC named arguments (Wladimir J. van der Laan) fba1a61 rpc: Named arguments for misc calls (Wladimir J. van der Laan) 286ec08 rpc: Add 'echo' call for testing (Wladimir J. van der Laan) 495eb44 rpc: Named arguments for blockchain calls (Wladimir J. van der Laan) 6f1c76a rpc: Support named arguments (Wladimir J. van der Laan) 5865d41 authproxy: Add support for RPC named arguments (Wladimir J. van der Laan)
Diffstat (limited to 'src/rpc/net.cpp')
-rw-r--r--src/rpc/net.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp
index 2af00c1de9..acbeb189e0 100644
--- a/src/rpc/net.cpp
+++ b/src/rpc/net.cpp
@@ -470,10 +470,10 @@ UniValue setban(const JSONRPCRequest& request)
if (request.fHelp || request.params.size() < 2 ||
(strCommand != "add" && strCommand != "remove"))
throw runtime_error(
- "setban \"ip(/netmask)\" \"add|remove\" (bantime) (absolute)\n"
+ "setban \"subnet\" \"add|remove\" (bantime) (absolute)\n"
"\nAttempts add or remove a IP/Subnet from the banned list.\n"
"\nArguments:\n"
- "1. \"ip(/netmask)\" (string, required) The IP/Subnet (see getpeerinfo for nodes ip) with a optional netmask (default is /32 = single ip)\n"
+ "1. \"subnet\" (string, required) The IP/Subnet (see getpeerinfo for nodes ip) with a optional netmask (default is /32 = single ip)\n"
"2. \"command\" (string, required) 'add' to add a IP/Subnet to the list, 'remove' to remove a IP/Subnet from the list\n"
"3. \"bantime\" (numeric, optional) time in seconds how long (or until when if [absolute] is set) the ip is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument)\n"
"4. \"absolute\" (boolean, optional) If set, the bantime must be a absolute timestamp in seconds since epoch (Jan 1 1970 GMT)\n"
@@ -582,7 +582,9 @@ UniValue setnetworkactive(const JSONRPCRequest& request)
if (request.fHelp || request.params.size() != 1) {
throw runtime_error(
"setnetworkactive true|false\n"
- "Disable/enable all p2p network activity."
+ "\nDisable/enable all p2p network activity.\n"
+ "\nArguments:\n"
+ "1. \"state\" (boolean, required) true to enable networking, false to disable\n"
);
}
@@ -598,18 +600,18 @@ UniValue setnetworkactive(const JSONRPCRequest& request)
static const CRPCCommand commands[] =
{ // category name actor (function) okSafeMode
// --------------------- ------------------------ ----------------------- ----------
- { "network", "getconnectioncount", &getconnectioncount, true },
- { "network", "ping", &ping, true },
- { "network", "getpeerinfo", &getpeerinfo, true },
- { "network", "addnode", &addnode, true },
- { "network", "disconnectnode", &disconnectnode, true },
- { "network", "getaddednodeinfo", &getaddednodeinfo, true },
- { "network", "getnettotals", &getnettotals, true },
- { "network", "getnetworkinfo", &getnetworkinfo, true },
- { "network", "setban", &setban, true },
- { "network", "listbanned", &listbanned, true },
- { "network", "clearbanned", &clearbanned, true },
- { "network", "setnetworkactive", &setnetworkactive, true, },
+ { "network", "getconnectioncount", &getconnectioncount, true, {} },
+ { "network", "ping", &ping, true, {} },
+ { "network", "getpeerinfo", &getpeerinfo, true, {} },
+ { "network", "addnode", &addnode, true, {"node","command"} },
+ { "network", "disconnectnode", &disconnectnode, true, {"node"} },
+ { "network", "getaddednodeinfo", &getaddednodeinfo, true, {"node"} },
+ { "network", "getnettotals", &getnettotals, true, {} },
+ { "network", "getnetworkinfo", &getnetworkinfo, true, {} },
+ { "network", "setban", &setban, true, {"subnet", "command", "bantime", "absolute"} },
+ { "network", "listbanned", &listbanned, true, {} },
+ { "network", "clearbanned", &clearbanned, true, {} },
+ { "network", "setnetworkactive", &setnetworkactive, true, {"state"} },
};
void RegisterNetRPCCommands(CRPCTable &t)