Disabled coinpayee cleanup

This commit is contained in:
Evan Duffield 2015-07-19 10:56:45 -07:00
parent 9668befdf4
commit 60f7428585

View File

@ -213,6 +213,8 @@ void CCoinbasePayee::ProcessBlockCoinbaseTX(CTransaction& txCoinbase, int64_t nT
if(mapPaidTime.count(h)){ if(mapPaidTime.count(h)){
if(mapPaidTime[h] < nTime) { if(mapPaidTime[h] < nTime) {
mapPaidTime[h] = nTime; mapPaidTime[h] = nTime;
} else {
LogPrintf("CCoinbasePayee::ProcessBlockCoinbaseTX - not updated -- %s - %d\n", h.ToString(), nTime);
} }
} else { } else {
mapPaidTime[h] = nTime; mapPaidTime[h] = nTime;
@ -233,14 +235,14 @@ int64_t CCoinbasePayee::GetLastPaid(CScript& pubkey)
void CCoinbasePayee::CleanUp() void CCoinbasePayee::CleanUp()
{ {
std::map<uint256, int64_t>::iterator it = mapPaidTime.begin(); // std::map<uint256, int64_t>::iterator it = mapPaidTime.begin();
while(it != mapPaidTime.end()) // while(it != mapPaidTime.end())
{ // {
//keep 30 days of history // //keep 30 days of history
if((*it).second < GetAdjustedTime() - (60*60*24*30)) { // if((*it).second < GetAdjustedTime() - (60*60*24*30)) {
mapPaidTime.erase(it++); // mapPaidTime.erase(it++);
} else { // } else {
++it; // ++it;
} // }
} // }
} }