Ensure cs_vNodes is held when using the return value from FindNode

zcash: cherry picked from commit 3c37dc40d39e1a1e56b6b0d3e660626a78656d4f
zcash: https://github.com/bitcoin/bitcoin/pull/9626
This commit is contained in:
Matt Corallo 2017-01-24 16:50:27 -05:00 committed by Larry Ruane
parent f60964c374
commit 024a94663c
1 changed files with 1 additions and 0 deletions

View File

@ -372,6 +372,7 @@ CNode* ConnectNode(CAddress addrConnect, const char *pszDest)
return NULL;
// Look for an existing connection
LOCK(cs_vNodes);
CNode* pnode = FindNode((CService)addrConnect);
if (pnode)
{