MCPcopy Create free account
hub / github.com/LUX-Core/lux / CleanPaymentList

Method CleanPaymentList

src/masternode.cpp:799–813  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

797}
798
799void 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
815bool CMasternodePayments::ProcessBlock(int nBlockHeight) {
816 LOCK(cs_masternodes);

Callers 1

ThreadCheckDarkSendPoolFunction · 0.80

Calls 7

maxFunction · 0.85
TipMethod · 0.80
HeightMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected