aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2017-02-06 02:34:57 -0500
committerMatt Corallo <git@bluematt.me>2017-02-10 11:32:39 -0500
commit321d0fc6b6624c65508f8b9059418cb936f0bbbe (patch)
tree57a99a1ede16e5449db2d230ddbc7a3b561547be /src/net_processing.cpp
parent2447c1024e6069bfe62ddff65c4e1aaf28f32b38 (diff)
downloadbitcoin-321d0fc6b6624c65508f8b9059418cb936f0bbbe.tar.xz
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.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index bb14e69d83..e89a897bd5 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";