Skip to content
Permalink
Browse files

Merge #39: [MN]: Fix possible MN deadlock

fix possible masternode deadlock
  • Loading branch information...
velesnetwork committed May 2, 2019
2 parents 10efc7e + 872b27f commit 4550a4a6d13042f57d1422c4eee2ff4120e9d32e
Showing with 12 additions and 3 deletions.
  1. +12 −3 src/masternodeman.cpp
@@ -154,7 +154,10 @@ bool CMasternodeMan::PoSeBan(const COutPoint &outpoint)

void CMasternodeMan::Check()
{
LOCK(cs);
// FXTC BEGIN
//LOCK(cs);
LOCK2(cs_main, cs);
// FXTC END

LogPrint(BCLog::MASTERNODE, "CMasternodeMan::Check -- nLastWatchdogVoteTime=%d, IsWatchdogActive()=%d\n", nLastWatchdogVoteTime, IsWatchdogActive());

@@ -1501,7 +1504,10 @@ bool CMasternodeMan::CheckMnbAndUpdateMasternodeList(CNode* pfrom, CMasternodeBr

void CMasternodeMan::UpdateLastPaid(const CBlockIndex* pindex)
{
LOCK(cs);
// FXTC BEGIN
//LOCK(cs);
LOCK2(cs_main, cs);
// FXTC END

if(fLiteMode || !masternodeSync.IsWinnersListSynced() || mapMasternodes.empty()) return;

@@ -1559,7 +1565,10 @@ void CMasternodeMan::RemoveGovernanceObject(uint256 nGovernanceObjectHash)

void CMasternodeMan::CheckMasternode(const CPubKey& pubKeyMasternode, bool fForce)
{
LOCK(cs);
// FXTC BEGIN
//LOCK(cs)
LOCK2(cs_main, cs);
// FXTC END
for (auto& mnpair : mapMasternodes) {
if (mnpair.second.pubKeyMasternode == pubKeyMasternode) {
mnpair.second.Check(fForce);

0 comments on commit 4550a4a

Please sign in to comment.
You can’t perform that action at this time.