aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/net.cpp
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2016-04-16 19:13:12 -0400
committerCory Fields <cory-nospam-@coryfields.com>2016-09-08 12:24:06 -0400
commit53347f0cb99e514815e44a56439a4a10012238f8 (patch)
treefc5baefe46ef918143904a299fd8aa5083097eda /src/rpc/net.cpp
parentc0569c7fa1e25599b3f1d6a16b15ec23052021da (diff)
net: create generic functor accessors and move vNodes to CConnman
Diffstat (limited to 'src/rpc/net.cpp')
-rw-r--r--src/rpc/net.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp
index 0d494a2e79..509b57aa72 100644
--- a/src/rpc/net.cpp
+++ b/src/rpc/net.cpp
@@ -55,13 +55,14 @@ UniValue ping(const UniValue& params, bool fHelp)
+ HelpExampleRpc("ping", "")
);
- // Request that each node send a ping during next message processing pass
- LOCK2(cs_main, cs_vNodes);
-
- BOOST_FOREACH(CNode* pNode, vNodes) {
- pNode->fPingQueued = true;
- }
+ if(!g_connman)
+ throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
+ // Request that each node send a ping during next message processing pass
+ g_connman->ForEachNode([](CNode* pnode) {
+ pnode->fPingQueued = true;
+ return true;
+ });
return NullUniValue;
}