From 944420deb0923cc54a6ab86debe4f3cefffeb924 Mon Sep 17 00:00:00 2001 From: Tim Flynn Date: Wed, 1 Feb 2017 18:07:24 -0500 Subject: [PATCH] Fix deadlock in governance on cs_main (#1303) --- src/governance.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/governance.cpp b/src/governance.cpp index 1474346fc..10d6bf1c1 100644 --- a/src/governance.cpp +++ b/src/governance.cpp @@ -879,7 +879,7 @@ bool CGovernanceManager::ProcessVote(CNode* pfrom, const CGovernanceVote& vote, void CGovernanceManager::CheckMasternodeOrphanVotes() { - LOCK(cs); + LOCK2(cs_main, cs); fRateChecksEnabled = false; for(object_m_it it = mapObjects.begin(); it != mapObjects.end(); ++it) { it->second.CheckOrphanVotes(); @@ -889,7 +889,7 @@ void CGovernanceManager::CheckMasternodeOrphanVotes() void CGovernanceManager::CheckMasternodeOrphanObjects() { - LOCK(cs); + LOCK2(cs_main, cs); int64_t nNow = GetAdjustedTime(); fRateChecksEnabled = false; object_time_m_it it = mapMasternodeOrphanObjects.begin();