Add ability to fetch CNode by NodeId

This commit is contained in:
Matt Corallo
2016-05-06 11:50:24 -07:00
parent d25cd3ec4e
commit 927f8eede0
2 changed files with 13 additions and 2 deletions

View File

@@ -368,6 +368,16 @@ CNode* FindNode(const CService& addr)
return NULL;
}
//TODO: This is used in only one place in main, and should be removed
CNode* FindNode(const NodeId nodeid)
{
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
if (pnode->GetId() == nodeid)
return (pnode);
return NULL;
}
CNode* ConnectNode(CAddress addrConnect, const char *pszDest, bool fCountFailure)
{
if (pszDest == NULL) {