mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Merge pull request #572 from UdjinM6/v0.12.1.x_fix_mem
V0.12.1.x more mem fixes:
This commit is contained in:
commit
518499a819
@ -593,7 +593,7 @@ bool CMasternodePayments::IsTransactionValid(const CTransaction& txNew, int nBlo
|
||||
|
||||
void CMasternodePayments::CleanPaymentList()
|
||||
{
|
||||
LOCK(cs_mapMasternodePayeeVotes);
|
||||
LOCK2(cs_mapMasternodePayeeVotes, cs_mapMasternodeBlocks);
|
||||
|
||||
if(chainActive.Tip() == NULL) return;
|
||||
|
||||
@ -608,6 +608,7 @@ void CMasternodePayments::CleanPaymentList()
|
||||
LogPrint("mnpayments", "CMasternodePayments::CleanPaymentList - Removing old Masternode payment - block %d\n", winner.nBlockHeight);
|
||||
masternodeSync.mapSeenSyncMNW.erase((*it).first);
|
||||
mapMasternodePayeeVotes.erase(it++);
|
||||
mapMasternodeBlocks.erase(winner.nBlockHeight);
|
||||
} else {
|
||||
++it;
|
||||
}
|
||||
|
@ -444,6 +444,7 @@ bool CMasternodeBroadcast::CheckInputsAndAdd(int& nDoS)
|
||||
if(!lockMain) {
|
||||
// not mnb fault, let it to be checked again later
|
||||
mnodeman.mapSeenMasternodeBroadcast.erase(GetHash());
|
||||
masternodeSync.mapSeenSyncMNB.erase(GetHash());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -460,6 +461,7 @@ bool CMasternodeBroadcast::CheckInputsAndAdd(int& nDoS)
|
||||
LogPrintf("mnb - Input must have at least %d confirmations\n", MASTERNODE_MIN_CONFIRMATIONS);
|
||||
// maybe we miss few blocks, let this mnb to be checked again later
|
||||
mnodeman.mapSeenMasternodeBroadcast.erase(GetHash());
|
||||
masternodeSync.mapSeenSyncMNB.erase(GetHash());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -327,8 +327,9 @@ void CMasternodeMan::CheckAndRemove(bool forceExpiredRemoval)
|
||||
// remove expired mapSeenMasternodeBroadcast
|
||||
map<uint256, CMasternodeBroadcast>::iterator it3 = mapSeenMasternodeBroadcast.begin();
|
||||
while(it3 != mapSeenMasternodeBroadcast.end()){
|
||||
if((*it3).second.sigTime < GetTime()-(MASTERNODE_MIN_MNP_SECONDS*2)){
|
||||
if((*it3).second.lastPing.sigTime < GetTime()-(MASTERNODE_REMOVAL_SECONDS*2)){
|
||||
mapSeenMasternodeBroadcast.erase(it3++);
|
||||
masternodeSync.mapSeenSyncMNB.erase((*it3).second.GetHash());
|
||||
} else {
|
||||
++it3;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user