Add ability to fetch CNode by NodeId

This commit is contained in:
Matt Corallo
2016-05-06 11:50:24 -07:00
committed by lateminer
parent 0fcad61796
commit 1ce3308431
2 changed files with 13 additions and 2 deletions

View File

@@ -370,6 +370,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)
{
if (pszDest == NULL) {