Skip to content

Commit

Permalink
Fix unlocked access to vNodes.size() (#1654)
Browse files Browse the repository at this point in the history
  • Loading branch information
the-schnibble authored and UdjinM6 committed Sep 25, 2017
1 parent 08e503d commit 7a89104
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 7a89104

Please sign in to comment.