net: create generic functor accessors and move vNodes to CConnman

This commit is contained in:
Cory Fields
2016-04-16 19:13:12 -04:00
parent c0569c7fa1
commit 53347f0cb9
7 changed files with 164 additions and 73 deletions

View File

@@ -55,13 +55,14 @@ UniValue ping(const UniValue& params, bool fHelp)
+ HelpExampleRpc("ping", "")
);
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
LOCK2(cs_main, cs_vNodes);
BOOST_FOREACH(CNode* pNode, vNodes) {
pNode->fPingQueued = true;
}
g_connman->ForEachNode([](CNode* pnode) {
pnode->fPingQueued = true;
return true;
});
return NullUniValue;
}