MCPcopy Create free account
hub / github.com/LUX-Core/lux / disconnectnode

Function disconnectnode

src/rpcnet.cpp:219–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219UniValue disconnectnode(const UniValue& params, bool fHelp)
220{
221 if (fHelp || params.size() != 1)
222 throw runtime_error(
223 "disconnectnode \"node\" \n"
224 "\nImmediately disconnects from the specified node.\n"
225 "\nArguments:\n"
226 "1. \"node\" (string, required) The node (see getpeerinfo for nodes)\n"
227 "\nExamples:\n"
228 + HelpExampleCli("disconnectnode", "\"192.168.0.6:8333\"")
229 + HelpExampleRpc("disconnectnode", "\"192.168.0.6:8333\"")
230 );
231
232 CNode* pNode = FindNode(params[0].get_str());
233 if (pNode == NULL)
234 throw JSONRPCError(RPC_CLIENT_NODE_NOT_CONNECTED, "Node not found in connected nodes");
235
236 pNode->CloseSocketDisconnect();
237
238 return NullUniValue;
239}
240
241UniValue getaddednodeinfo(const UniValue& params, bool fHelp)
242{

Callers

nothing calls this directly

Calls 7

HelpExampleCliFunction · 0.85
HelpExampleRpcFunction · 0.85
JSONRPCErrorFunction · 0.85
get_strMethod · 0.80
CloseSocketDisconnectMethod · 0.80
FindNodeFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected