mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 13:03:17 +01:00
Fix super-unlikely race introduced in 236618061a
Once the CNode has been added to vNodes, it is possible that it is disconnected+deleted in the socket handler thread. However, after that we now call InitializeNode, which accesses the pnode. helgrind managed to tickle this case (somehow), but I suspect it requires in immensely braindead scheduler.
This commit is contained in:
parent
1c2edd9f67
commit
885cfdd217
@ -1833,11 +1833,11 @@ bool CConnman::OpenNetworkConnection(const CAddress& addrConnect, bool fCountFai
|
|||||||
if (fAddnode)
|
if (fAddnode)
|
||||||
pnode->fAddnode = true;
|
pnode->fAddnode = true;
|
||||||
|
|
||||||
|
GetNodeSignals().InitializeNode(pnode, *this);
|
||||||
{
|
{
|
||||||
LOCK(cs_vNodes);
|
LOCK(cs_vNodes);
|
||||||
vNodes.push_back(pnode);
|
vNodes.push_back(pnode);
|
||||||
}
|
}
|
||||||
GetNodeSignals().InitializeNode(pnode, *this);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user