From 6cd6722c084df68fa6457dc9242dc6f6d74b9776 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Wed, 30 Nov 2016 04:48:05 +0400 Subject: [PATCH] fix deadlocks for MNVERIFY processing (#1173) --- src/masternodeman.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp index 90b0e4b79..b5721a970 100644 --- a/src/masternodeman.cpp +++ b/src/masternodeman.cpp @@ -813,7 +813,8 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData } else if (strCommand == NetMsgType::MNVERIFY) { // Masternode Verify - LOCK(cs); + // Need LOCK2 here to ensure consistent locking order because the all functions below call GetBlockHash which locks cs_main + LOCK2(cs_main, cs); CMasternodeVerification mnv; vRecv >> mnv;