fixed potential deadlock in CMasternodePing::SimpleCheck (#1534)
This commit is contained in:
parent
9e9df28203
commit
e0d6c5b5a2
@ -821,7 +821,7 @@ bool CMasternodePing::SimpleCheck(int& nDos)
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
LOCK(cs_main);
|
AssertLockHeld(cs_main);
|
||||||
BlockMap::iterator mi = mapBlockIndex.find(blockHash);
|
BlockMap::iterator mi = mapBlockIndex.find(blockHash);
|
||||||
if (mi == mapBlockIndex.end()) {
|
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());
|
LogPrint("masternode", "CMasternodePing::SimpleCheck -- Masternode ping is invalid, unknown block hash: masternode=%s blockHash=%s\n", vin.prevout.ToStringShort(), blockHash.ToString());
|
||||||
|
@ -1382,7 +1382,7 @@ std::string CMasternodeMan::ToString() const
|
|||||||
|
|
||||||
void CMasternodeMan::UpdateMasternodeList(CMasternodeBroadcast mnb)
|
void CMasternodeMan::UpdateMasternodeList(CMasternodeBroadcast mnb)
|
||||||
{
|
{
|
||||||
LOCK(cs);
|
LOCK2(cs_main, cs);
|
||||||
mapSeenMasternodePing.insert(std::make_pair(mnb.lastPing.GetHash(), mnb.lastPing));
|
mapSeenMasternodePing.insert(std::make_pair(mnb.lastPing.GetHash(), mnb.lastPing));
|
||||||
mapSeenMasternodeBroadcast.insert(std::make_pair(mnb.GetHash(), std::make_pair(GetTime(), mnb)));
|
mapSeenMasternodeBroadcast.insert(std::make_pair(mnb.GetHash(), std::make_pair(GetTime(), mnb)));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user