Skip to content

Commit

Permalink
fixed potential deadlock in CMasternodePing::SimpleCheck (#1534)
Browse files Browse the repository at this point in the history
  • Loading branch information
the-schnibble authored and UdjinM6 committed Jul 17, 2017
1 parent 9e9df28 commit e0d6c5b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/masternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ bool CMasternodePing::SimpleCheck(int& nDos)
}

{
LOCK(cs_main);
AssertLockHeld(cs_main);
BlockMap::iterator mi = mapBlockIndex.find(blockHash);
if (mi == mapBlockIndex.end()) {
LogPrint("masternode", "CMasternodePing::SimpleCheck -- Masternode ping is invalid, unknown block hash: masternode=%s blockHash=%s\n", vin.prevout.ToStringShort(), blockHash.ToString());
Expand Down
2 changes: 1 addition & 1 deletion src/masternodeman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,7 @@ std::string CMasternodeMan::ToString() const

void CMasternodeMan::UpdateMasternodeList(CMasternodeBroadcast mnb)
{
LOCK(cs);
LOCK2(cs_main, cs);
mapSeenMasternodePing.insert(std::make_pair(mnb.lastPing.GetHash(), mnb.lastPing));
mapSeenMasternodeBroadcast.insert(std::make_pair(mnb.GetHash(), std::make_pair(GetTime(), mnb)));

Expand Down

0 comments on commit e0d6c5b

Please sign in to comment.