Skip to content

Commit 885cfdd

Browse files
committed
Fix super-unlikely race introduced in 2366180
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.
1 parent 1c2edd9 commit 885cfdd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1833,11 +1833,11 @@ bool CConnman::OpenNetworkConnection(const CAddress& addrConnect, bool fCountFai
18331833
if (fAddnode)
18341834
pnode->fAddnode = true;
18351835

1836+
GetNodeSignals().InitializeNode(pnode, *this);
18361837
{
18371838
LOCK(cs_vNodes);
18381839
vNodes.push_back(pnode);
18391840
}
1840-
GetNodeSignals().InitializeNode(pnode, *this);
18411841

18421842
return true;
18431843
}

0 commit comments

Comments
 (0)