Fig a bug in the way we traverse TaggedCaches and a similar bug in mPeerPositions.

This commit is contained in:
JoelKatz
2013-02-25 20:28:20 -08:00
parent 923446fb78
commit 7b14d2d44a
2 changed files with 3 additions and 3 deletions

View File

@@ -728,7 +728,7 @@ void LedgerConsensus::updateOurPositions()
cLog(lsWARNING) << "Removing stale proposal from " << peerID; cLog(lsWARNING) << "Removing stale proposal from " << peerID;
BOOST_FOREACH(u256_lct_pair& it, mDisputes) BOOST_FOREACH(u256_lct_pair& it, mDisputes)
it.second->unVote(peerID); it.second->unVote(peerID);
mPeerPositions.erase(it++); it = mPeerPositions.erase(it);
} }
else else
{ // proposal is still fresh { // proposal is still fresh

View File

@@ -152,7 +152,7 @@ template<typename c_Key, typename c_Data> void TaggedCache<c_Key, c_Data>::sweep
if (cit->second.isExpired()) if (cit->second.isExpired())
{ {
++mapRemovals; ++mapRemovals;
mCache.erase(cit++); cit = mCache.erase(cit);
} }
else else
++cit; ++cit;
@@ -165,7 +165,7 @@ template<typename c_Key, typename c_Data> void TaggedCache<c_Key, c_Data>::sweep
if (cit->second.isExpired()) if (cit->second.isExpired())
{ {
++mapRemovals; ++mapRemovals;
mCache.erase(cit++); cit = mCache.erase(cit);
} }
else // remains weakly cached else // remains weakly cached
++cit; ++cit;