|
|
@ -27,7 +27,7 @@ Value ping(const Array& params, bool fHelp) |
|
|
|
"Requests that a ping be sent to all other nodes, to measure ping time.\n" |
|
|
|
"Requests that a ping be sent to all other nodes, to measure ping time.\n" |
|
|
|
"Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds.\n" |
|
|
|
"Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds.\n" |
|
|
|
"Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping."); |
|
|
|
"Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping."); |
|
|
|
|
|
|
|
|
|
|
|
// Request that each node send a ping during next message processing pass
|
|
|
|
// Request that each node send a ping during next message processing pass
|
|
|
|
LOCK(cs_vNodes); |
|
|
|
LOCK(cs_vNodes); |
|
|
|
BOOST_FOREACH(CNode* pNode, vNodes) { |
|
|
|
BOOST_FOREACH(CNode* pNode, vNodes) { |
|
|
@ -120,13 +120,13 @@ Value addnode(const Array& params, bool fHelp) |
|
|
|
if (strCommand == "add") |
|
|
|
if (strCommand == "add") |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (it != vAddedNodes.end()) |
|
|
|
if (it != vAddedNodes.end()) |
|
|
|
throw JSONRPCError(-23, "Error: Node already added"); |
|
|
|
throw JSONRPCError(RPC_CLIENT_NODE_ALREADY_ADDED, "Error: Node already added"); |
|
|
|
vAddedNodes.push_back(strNode); |
|
|
|
vAddedNodes.push_back(strNode); |
|
|
|
} |
|
|
|
} |
|
|
|
else if(strCommand == "remove") |
|
|
|
else if(strCommand == "remove") |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (it == vAddedNodes.end()) |
|
|
|
if (it == vAddedNodes.end()) |
|
|
|
throw JSONRPCError(-24, "Error: Node has not been added."); |
|
|
|
throw JSONRPCError(RPC_CLIENT_NODE_NOT_ADDED, "Error: Node has not been added."); |
|
|
|
vAddedNodes.erase(it); |
|
|
|
vAddedNodes.erase(it); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -163,7 +163,7 @@ Value getaddednodeinfo(const Array& params, bool fHelp) |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (laddedNodes.size() == 0) |
|
|
|
if (laddedNodes.size() == 0) |
|
|
|
throw JSONRPCError(-24, "Error: Node has not been added."); |
|
|
|
throw JSONRPCError(RPC_CLIENT_NODE_NOT_ADDED, "Error: Node has not been added."); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!fDns) |
|
|
|
if (!fDns) |
|
|
|