| 217 | } |
| 218 | |
| 219 | UniValue 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 | |
| 241 | UniValue getaddednodeinfo(const UniValue& params, bool fHelp) |
| 242 | { |
nothing calls this directly
no test coverage detected