|
|
@ -571,6 +571,24 @@ UniValue clearbanned(const UniValue& params, bool fHelp) |
|
|
|
return NullUniValue; |
|
|
|
return NullUniValue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UniValue togglenetwork(const JSONRPCRequest& request) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (request.fHelp || request.params.size() != 0) { |
|
|
|
|
|
|
|
throw runtime_error( |
|
|
|
|
|
|
|
"togglenetwork\n" |
|
|
|
|
|
|
|
"Toggle all network activity temporarily." |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!g_connman) { |
|
|
|
|
|
|
|
throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_connman->SetNetworkActive(!g_connman->GetNetworkActive()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return g_connman->GetNetworkActive(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static const CRPCCommand commands[] = |
|
|
|
static const CRPCCommand commands[] = |
|
|
|
{ // category name actor (function) okSafeMode
|
|
|
|
{ // category name actor (function) okSafeMode
|
|
|
|
// --------------------- ------------------------ ----------------------- ----------
|
|
|
|
// --------------------- ------------------------ ----------------------- ----------
|
|
|
@ -585,6 +603,7 @@ static const CRPCCommand commands[] = |
|
|
|
{ "network", "setban", &setban, true }, |
|
|
|
{ "network", "setban", &setban, true }, |
|
|
|
{ "network", "listbanned", &listbanned, true }, |
|
|
|
{ "network", "listbanned", &listbanned, true }, |
|
|
|
{ "network", "clearbanned", &clearbanned, true }, |
|
|
|
{ "network", "clearbanned", &clearbanned, true }, |
|
|
|
|
|
|
|
{ "network", "togglenetwork", &togglenetwork, true, }, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
void RegisterNetRPCCommands(CRPCTable &t) |
|
|
|
void RegisterNetRPCCommands(CRPCTable &t) |
|
|
|