Fix unlocked access to vNodes.size() (#1654)

This commit is contained in:
Ilya Savinov 2017-09-25 17:16:56 +03:00 committed by UdjinM6
parent 08e503da28
commit 7a8910443c

View File

@ -1170,8 +1170,13 @@ void CConnman::ThreadSocketHandler()
}
}
}
if(vNodes.size() != nPrevNodeCount) {
nPrevNodeCount = vNodes.size();
size_t vNodesSize;
{
LOCK(cs_vNodes);
vNodesSize = vNodes.size();
}
if(vNodesSize != nPrevNodeCount) {
nPrevNodeCount = vNodesSize;
if(clientInterface)
clientInterface->NotifyNumConnectionsChanged(nPrevNodeCount);
}