diff options
| author | Cory Fields <[email protected]> | 2017-02-06 02:34:57 -0500 |
|---|---|---|
| committer | Matt Corallo <[email protected]> | 2017-02-10 11:32:39 -0500 |
| commit | 321d0fc6b6624c65508f8b9059418cb936f0bbbe (patch) | |
| tree | 57a99a1ede16e5449db2d230ddbc7a3b561547be /src/net_processing.cpp | |
| parent | Merge #9698: net: fix socket close race (diff) | |
| download | discoin-321d0fc6b6624c65508f8b9059418cb936f0bbbe.tar.xz discoin-321d0fc6b6624c65508f8b9059418cb936f0bbbe.zip | |
net: fix a few races. Credit @TheBlueMatt
These are (afaik) all long-standing races or concurrent accesses. Going
forward, we can clean these up so that they're not all individual atomic
accesses.
- Reintroduce cs_vRecv to guard receive-specific vars
- Lock vRecv/vSend for CNodeStats
- Make some vars atomic.
- Only set the connection time in CNode's constructor so that it doesn't change
Diffstat (limited to 'src/net_processing.cpp')
| -rw-r--r-- | src/net_processing.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index bb14e69d8..e89a897bd 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2450,7 +2450,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr if (pingUsecTime > 0) { // Successful ping time measurement, replace previous pfrom->nPingUsecTime = pingUsecTime; - pfrom->nMinPingUsecTime = std::min(pfrom->nMinPingUsecTime, pingUsecTime); + pfrom->nMinPingUsecTime = std::min(pfrom->nMinPingUsecTime.load(), pingUsecTime); } else { // This should never happen sProblem = "Timing mishap"; |