aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorCory Fields <[email protected]>2015-06-16 04:02:25 -0400
committerCory Fields <[email protected]>2015-06-16 04:04:02 -0400
commit2b890dd424b32320be6fc0333e67e2d7c9616065 (patch)
treec20253faf3dd5346a8c4b2686144fb59edb2bac2 /src/net.cpp
parentlocking: teach Clang's -Wthread-safety to cope with our scoped lock macros (diff)
downloaddiscoin-2b890dd424b32320be6fc0333e67e2d7c9616065.tar.xz
discoin-2b890dd424b32320be6fc0333e67e2d7c9616065.zip
locking: fix a few small issues uncovered by -Wthread-safety
- rpcwallet: No need to lock twice here - openssl: Clang doesn't understand selective lock/unlock here. Ignore it. - CNode: Fix a legitimate (though very unlikely) locking bug.
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 42ac0e50e..adf89554d 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -2032,8 +2032,10 @@ void CNode::EndMessage() UNLOCK_FUNCTION(cs_vSend)
Fuzz(GetArg("-fuzzmessagestest", 10));
if (ssSend.size() == 0)
+ {
+ LEAVE_CRITICAL_SECTION(cs_vSend);
return;
-
+ }
// Set the size
unsigned int nSize = ssSend.size() - CMessageHeader::HEADER_SIZE;
WriteLE32((uint8_t*)&ssSend[CMessageHeader::MESSAGE_SIZE_OFFSET], nSize);