diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2012-04-17 11:05:02 -0700 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2012-04-17 11:05:02 -0700 |
commit | caeddc5d3738c95e0755560aa3d9b1f32e9fbce5 (patch) | |
tree | ab6df15302cd3c818e45e6f19330b044db988a94 | |
parent | 1ffeb89a52d82bb62860786ff6426224437ca7b1 (diff) | |
parent | c581cc16bb5e490c0960ccf440de2d1e5f23c417 (diff) |
Merge pull request #1117 from sipa/deadlockfix
Fix potential deadlock
-rw-r--r-- | src/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 16a1f34556..46b409cdaa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2838,8 +2838,8 @@ bool ProcessMessages(CNode* pfrom) bool SendMessages(CNode* pto, bool fSendTrickle) { - { - LOCK(cs_main); + TRY_LOCK(cs_main, lockMain); + if (lockMain) { // Don't send anything until we get their version message if (pto->nVersion == 0) return true; |