| 797 | } |
| 798 | |
| 799 | void CMasternodePayments::CleanPaymentList() { |
| 800 | LOCK(cs_masternodes); |
| 801 | if (chainActive.Tip() == NULL) return; |
| 802 | |
| 803 | int nLimit = std::max(((int) vecMasternodes.size()) * 2, 1000); |
| 804 | |
| 805 | vector<CMasternodePaymentWinner>::iterator it; |
| 806 | for (it = vWinning.begin(); it < vWinning.end(); it++) { |
| 807 | if (chainActive.Height() - (*it).nBlockHeight > nLimit) { |
| 808 | if (fDebug) LogPrintf("CMasternodePayments::CleanPaymentList - Removing old masternode payment - block %d\n", (*it).nBlockHeight); |
| 809 | vWinning.erase(it); |
| 810 | break; |
| 811 | } |
| 812 | } |
| 813 | } |
| 814 | |
| 815 | bool CMasternodePayments::ProcessBlock(int nBlockHeight) { |
| 816 | LOCK(cs_masternodes); |