mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Merge #9225: Fix some benign races
dfed983Fix unlocked access to vNodes.size() (Matt Corallo)3033522Remove double brackets in addrman (Matt Corallo)dbfaadeFix AddrMan locking (Matt Corallo)047ea10Make fImporting an std::atomic (Matt Corallo)42071caMake fDisconnect an std::atomic (Matt Corallo)
This commit is contained in:
@@ -1103,8 +1103,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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user