mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Add ability to fetch CNode by NodeId
This commit is contained in:
10
src/net.cpp
10
src/net.cpp
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user