diff options
author | Cory Fields <cory-nospam-@coryfields.com> | 2016-04-16 19:13:12 -0400 |
---|---|---|
committer | Cory Fields <cory-nospam-@coryfields.com> | 2016-09-08 12:24:06 -0400 |
commit | 53347f0cb99e514815e44a56439a4a10012238f8 (patch) | |
tree | fc5baefe46ef918143904a299fd8aa5083097eda /src/rpc/net.cpp | |
parent | c0569c7fa1e25599b3f1d6a16b15ec23052021da (diff) |
net: create generic functor accessors and move vNodes to CConnman
Diffstat (limited to 'src/rpc/net.cpp')
-rw-r--r-- | src/rpc/net.cpp | 13 |
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; } |