Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/net.cpp
Show First 20 Lines • Show All 772 Lines • ▼ Show 20 Lines | static UniValue setnetworkactive(const Config &config, | ||||
g_connman->SetNetworkActive(request.params[0].get_bool()); | g_connman->SetNetworkActive(request.params[0].get_bool()); | ||||
return g_connman->GetNetworkActive(); | return g_connman->GetNetworkActive(); | ||||
} | } | ||||
// clang-format off | // clang-format off | ||||
static const ContextFreeRPCCommand commands[] = { | static const ContextFreeRPCCommand commands[] = { | ||||
// category name actor (function) okSafeMode | // category name actor (function) argNames | ||||
// ------------------- ------------------------ ---------------------- ---------- | // ------------------- ------------------------ ---------------------- ---------- | ||||
{ "network", "getconnectioncount", getconnectioncount, true, {} }, | { "network", "getconnectioncount", getconnectioncount, {} }, | ||||
{ "network", "ping", ping, true, {} }, | { "network", "ping", ping, {} }, | ||||
{ "network", "getpeerinfo", getpeerinfo, true, {} }, | { "network", "getpeerinfo", getpeerinfo, {} }, | ||||
{ "network", "addnode", addnode, true, {"node","command"} }, | { "network", "addnode", addnode, {"node","command"} }, | ||||
{ "network", "disconnectnode", disconnectnode, true, {"address", "nodeid"} }, | { "network", "disconnectnode", disconnectnode, {"address", "nodeid"} }, | ||||
{ "network", "getaddednodeinfo", getaddednodeinfo, true, {"node"} }, | { "network", "getaddednodeinfo", getaddednodeinfo, {"node"} }, | ||||
{ "network", "getnettotals", getnettotals, true, {} }, | { "network", "getnettotals", getnettotals, {} }, | ||||
{ "network", "getnetworkinfo", getnetworkinfo, true, {} }, | { "network", "getnetworkinfo", getnetworkinfo, {} }, | ||||
{ "network", "setban", setban, true, {"subnet", "command", "bantime", "absolute"} }, | { "network", "setban", setban, {"subnet", "command", "bantime", "absolute"} }, | ||||
{ "network", "listbanned", listbanned, true, {} }, | { "network", "listbanned", listbanned, {} }, | ||||
{ "network", "clearbanned", clearbanned, true, {} }, | { "network", "clearbanned", clearbanned, {} }, | ||||
{ "network", "setnetworkactive", setnetworkactive, true, {"state"} }, | { "network", "setnetworkactive", setnetworkactive, {"state"} }, | ||||
}; | }; | ||||
// clang-format on | // clang-format on | ||||
void RegisterNetRPCCommands(CRPCTable &t) { | void RegisterNetRPCCommands(CRPCTable &t) { | ||||
for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++) { | for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++) { | ||||
t.appendCommand(commands[vcidx].name, &commands[vcidx]); | t.appendCommand(commands[vcidx].name, &commands[vcidx]); | ||||
} | } | ||||
} | } |