Masternode index rebuild bug fix (#1318)
* Clear old masternode index after vote map rebuild * Add masternode index size to CMasternodeMan::ToString
This commit is contained in:
parent
1d45023f3e
commit
5520bf6895
@ -1115,9 +1115,12 @@ int CGovernanceManager::GetMasternodeIndex(const CTxIn& masternodeVin)
|
||||
LOCK(cs);
|
||||
bool fIndexRebuilt = false;
|
||||
int nMNIndex = mnodeman.GetMasternodeIndex(masternodeVin, fIndexRebuilt);
|
||||
while(fIndexRebuilt) {
|
||||
if(fIndexRebuilt) {
|
||||
RebuildVoteMaps();
|
||||
nMNIndex = mnodeman.GetMasternodeIndex(masternodeVin, fIndexRebuilt);
|
||||
if(fIndexRebuilt) {
|
||||
LogPrintf("CGovernanceManager::GetMasternodeIndex -- WARNING: vote map rebuild failed\n");
|
||||
}
|
||||
}
|
||||
return nMNIndex;
|
||||
}
|
||||
@ -1127,6 +1130,7 @@ void CGovernanceManager::RebuildVoteMaps()
|
||||
for(object_m_it it = mapObjects.begin(); it != mapObjects.end(); ++it) {
|
||||
it->second.RebuildVoteMap();
|
||||
}
|
||||
mnodeman.ClearOldMasternodeIndex();
|
||||
}
|
||||
|
||||
void CGovernanceManager::AddCachedTriggers()
|
||||
|
@ -1362,6 +1362,7 @@ std::string CMasternodeMan::ToString() const
|
||||
", 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() <<
|
||||
", masternode index size: " << indexMasternodes.GetSize() <<
|
||||
", nDsqCount: " << (int)nDsqCount;
|
||||
|
||||
return info.str();
|
||||
|
Loading…
Reference in New Issue
Block a user