check and remove expired masternodes on client start / more info on load/flush
This commit is contained in:
parent
2d3426755c
commit
4af7c7411a
@ -1160,10 +1160,12 @@ bool AppInit2(boost::thread_group& threadGroup)
|
||||
CMasternodeDB mndb;
|
||||
if (!mndb.Read(mnodeman))
|
||||
LogPrintf("Invalid or missing masternodes.dat; recreating\n");
|
||||
else
|
||||
mnodeman.CheckAndRemove(); // clean out expired
|
||||
}
|
||||
|
||||
LogPrintf("Loaded %i masternodes from masternodes.dat %dms\n",
|
||||
mnodeman.size(), GetTimeMillis() - nStart);
|
||||
LogPrintf("Loaded info from masternodes.dat %dms\n", GetTimeMillis() - nStart);
|
||||
LogPrintf(" %s\n", mnodeman.ToString());
|
||||
|
||||
|
||||
fMasterNode = GetBoolArg("-masternode", false);
|
||||
|
@ -123,7 +123,8 @@ void DumpMasternodes()
|
||||
CMasternodeDB mndb;
|
||||
mndb.Write(mnodeman);
|
||||
|
||||
LogPrintf("Flushed %d masternodes to masternodes.dat %dms\n", mnodeman.size(), GetTimeMillis() - nStart);
|
||||
LogPrintf("Flushed info to masternodes.dat %dms\n", GetTimeMillis() - nStart);
|
||||
LogPrintf(" %s\n", mnodeman.ToString());
|
||||
}
|
||||
|
||||
CMasternodeMan::CMasternodeMan() {}
|
||||
@ -628,3 +629,15 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::string CMasternodeMan::ToString()
|
||||
{
|
||||
std::ostringstream info;
|
||||
|
||||
info << "masternodes: " << (int)vMasternodes.size() <<
|
||||
", peers who asked us for masternode list: " << (int)mAskedUsForMasternodeList.size() <<
|
||||
", peers we asked for masternode list: " << (int)mWeAskedForMasternodeList.size() <<
|
||||
", entries in masternode list we asked for: " << (int)mWeAskedForMasternodeListEntry.size();
|
||||
|
||||
return info.str();
|
||||
}
|
||||
|
@ -113,6 +113,8 @@ public:
|
||||
// Return the number of (unique) masternodes
|
||||
int size() { return vMasternodes.size(); }
|
||||
|
||||
std::string ToString();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user