diff --git a/src/governance.cpp b/src/governance.cpp index c7fad7bc8f..fe816b4a53 100644 --- a/src/governance.cpp +++ b/src/governance.cpp @@ -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() diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp index ce964240b0..42c9e1e140 100644 --- a/src/masternodeman.cpp +++ b/src/masternodeman.cpp @@ -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();