Clean up old acquires.

This commit is contained in:
JoelKatz
2013-01-07 08:57:20 -08:00
parent e9fad1a431
commit 6624e31d5a
3 changed files with 17 additions and 0 deletions

View File

@@ -724,4 +724,18 @@ bool LedgerAcquireMaster::isFailure(const uint256& hash)
return mRecentFailures.find(hash) != mRecentFailures.end();
}
void LedgerAcquireMaster::sweep()
{
boost::mutex::scoped_lock sl(mLock);
std::map<uint256, LedgerAcquire::pointer>::iterator it = mLedgers.begin();
while (it != mLedgers.end())
{
if (it->second->isDone())
mLedgers.erase(it++);
else
++it;
}
}
// vim:ts=4