aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-04-17 18:50:45 +0200
committerLuke Dashjr <luke-jr+git@utopios.org>2012-04-17 15:11:48 -0400
commitdc588faf5922d8ca449dea61bbe899532497c914 (patch)
treee796fc3e5ea6709ec62d5de2a9b99fc4047afa9c /src
parent7f34351910ee63685beb169895a3eb5ef266dbb5 (diff)
downloadbitcoin-dc588faf5922d8ca449dea61bbe899532497c914.tar.xz
Fix potential deadlock
Conflict: * cs_main in ProcessMessages() (before calling ProcessMessages) * cs_vSend in CNode::BeginMessage versus: * cs_vSend in ThreadMessageHandler2 (before calling SendMessages) * cs_main in SendMessages Even though cs_vSend is a try_lock, if it succeeds simultaneously with the locking of cs_main in ProcessMessages(), it could cause a deadlock.
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 76e0783794..e6f94210b9 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2618,7 +2618,7 @@ bool ProcessMessages(CNode* pfrom)
bool SendMessages(CNode* pto, bool fSendTrickle)
{
- CRITICAL_BLOCK(cs_main)
+ TRY_CRITICAL_BLOCK(cs_main)
{
// Don't send anything until we get their version message
if (pto->nVersion == 0)