Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/net.cpp
Show First 20 Lines • Show All 242 Lines • ▼ Show 20 Lines | static UniValue addnode(const Config &config, const JSONRPCRequest &request) { | ||||
if (!request.params[1].isNull()) { | if (!request.params[1].isNull()) { | ||||
strCommand = request.params[1].get_str(); | strCommand = request.params[1].get_str(); | ||||
} | } | ||||
if (request.fHelp || request.params.size() != 2 || | if (request.fHelp || request.params.size() != 2 || | ||||
(strCommand != "onetry" && strCommand != "add" && | (strCommand != "onetry" && strCommand != "add" && | ||||
strCommand != "remove")) { | strCommand != "remove")) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"addnode \"node\" \"add|remove|onetry\"\n" | "addnode \"node\" \"command\"\n" | ||||
"\nAttempts to add or remove a node from the addnode list.\n" | "\nAttempts to add or remove a node from the addnode list.\n" | ||||
"Or try a connection to a node once.\n" | "Or try a connection to a node once.\n" | ||||
"Nodes added using addnode (or -connect) are protected from DoS " | "Nodes added using addnode (or -connect) are protected from DoS " | ||||
"disconnection and are not required to be\n" | "disconnection and are not required to be\n" | ||||
"full nodes as other outbound peers are (though " | "full nodes as other outbound peers are (though " | ||||
"such peers will not be synced from).\n" | "such peers will not be synced from).\n" | ||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"node\" (string, required) The node (see getpeerinfo for " | "1. \"node\" (string, required) The node (see getpeerinfo for " | ||||
Show All 33 Lines | static UniValue addnode(const Config &config, const JSONRPCRequest &request) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
static UniValue disconnectnode(const Config &config, | static UniValue disconnectnode(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() == 0 || | if (request.fHelp || request.params.size() == 0 || | ||||
request.params.size() >= 3) { | request.params.size() >= 3) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"disconnectnode \"[address]\" [nodeid]\n" | "disconnectnode ( \"address\" nodeid )\n" | ||||
"\nImmediately disconnects from the specified peer node.\n" | "\nImmediately disconnects from the specified peer node.\n" | ||||
"\nStrictly one out of 'address' and 'nodeid' can be provided to " | "\nStrictly one out of 'address' and 'nodeid' can be provided to " | ||||
"identify the node.\n" | "identify the node.\n" | ||||
"\nTo disconnect by nodeid, either set 'address' to the empty " | "\nTo disconnect by nodeid, either set 'address' to the empty " | ||||
"string, or call using the named 'nodeid' argument only.\n" | "string, or call using the named 'nodeid' argument only.\n" | ||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"address\" (string, optional) The IP address/port of the " | "1. \"address\" (string, optional) The IP address/port of the " | ||||
"node\n" | "node\n" | ||||
▲ Show 20 Lines • Show All 308 Lines • ▼ Show 20 Lines | static UniValue setban(const Config &config, const JSONRPCRequest &request) { | ||||
std::string strCommand; | std::string strCommand; | ||||
if (!request.params[1].isNull()) { | if (!request.params[1].isNull()) { | ||||
strCommand = request.params[1].get_str(); | strCommand = request.params[1].get_str(); | ||||
} | } | ||||
if (request.fHelp || request.params.size() < 2 || | if (request.fHelp || request.params.size() < 2 || | ||||
(strCommand != "add" && strCommand != "remove")) { | (strCommand != "add" && strCommand != "remove")) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"setban \"subnet\" \"add|remove\" (bantime) (absolute)\n" | "setban \"subnet\" \"command\" ( bantime absolute )\n" | ||||
"\nAttempts to add or remove a IP/Subnet from the banned list.\n" | "\nAttempts to add or remove a IP/Subnet from the banned list.\n" | ||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"subnet\" (string, required) The IP/Subnet (see " | "1. \"subnet\" (string, required) The IP/Subnet (see " | ||||
"getpeerinfo for nodes IP) with an optional netmask (default is " | "getpeerinfo for nodes IP) with an optional netmask (default is " | ||||
"/32 " | "/32 " | ||||
"= single IP)\n" | "= single IP)\n" | ||||
"2. \"command\" (string, required) 'add' to add an IP/Subnet " | "2. \"command\" (string, required) 'add' to add an IP/Subnet " | ||||
"to the list, 'remove' to remove an IP/Subnet from the list\n" | "to the list, 'remove' to remove an IP/Subnet from the list\n" | ||||
▲ Show 20 Lines • Show All 127 Lines • ▼ Show 20 Lines | static UniValue clearbanned(const Config &config, | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
static UniValue setnetworkactive(const Config &config, | static UniValue setnetworkactive(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"setnetworkactive true|false\n" | "setnetworkactive state\n" | ||||
"\nDisable/enable all p2p network activity.\n" | "\nDisable/enable all p2p network activity.\n" | ||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"state\" (boolean, required) true to " | "1. \"state\" (boolean, required) true to " | ||||
"enable networking, false to disable\n"); | "enable networking, false to disable\n"); | ||||
} | } | ||||
if (!g_connman) { | if (!g_connman) { | ||||
throw JSONRPCError( | throw JSONRPCError( | ||||
▲ Show 20 Lines • Show All 95 Lines • Show Last 20 Lines |