aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2016-05-06 11:50:24 -0700
committerMatt Corallo <git@bluematt.me>2016-06-19 23:06:55 -0700
commit927f8eede0c9e0ab9cc2b5e43e39cfe3e1340dd6 (patch)
tree5881ee45f21ce4ca0c23d86350fabbdba855a140 /src/net.cpp
parentd25cd3ec4e8961c5f36c29a65395f52d0db294c5 (diff)
Add ability to fetch CNode by NodeId
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 4eca3d75cc..336163a896 100644
--- a/src/net.cpp
+++ b/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) {