aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2017-02-02 20:03:46 -0500
committerMatt Corallo <git@bluematt.me>2017-02-02 20:03:46 -0500
commitfd13eca147be80f3ebd1a5a1db1ce75bbeeb1953 (patch)
tree20264c24f6a72441d97670f977f9a8cc86ed89aa /src/net.cpp
parent1c2edd9f6707d16c03ecfba094b1cfec2ddc4dce (diff)
Lock cs_vSend and cs_inventory in a consistent order even in TRY
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/net.cpp b/src/net.cpp
index df88b12c76..5cddc6f44d 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1070,12 +1070,13 @@ void CConnman::ThreadSocketHandler()
{
bool fDelete = false;
{
- TRY_LOCK(pnode->cs_vSend, lockSend);
- if (lockSend)
+ TRY_LOCK(pnode->cs_inventory, lockInv);
+ if (lockInv)
{
- TRY_LOCK(pnode->cs_inventory, lockInv);
- if (lockInv)
- fDelete = true;
+ TRY_LOCK(pnode->cs_vSend, lockSend);
+ if (lockSend) {
+ fDelete = true;
+ }
}
}
if (fDelete)