diff --git a/src/cpp/ripple/LedgerAcquire.cpp b/src/cpp/ripple/LedgerAcquire.cpp index ddee47a4cb..462ab33ba2 100644 --- a/src/cpp/ripple/LedgerAcquire.cpp +++ b/src/cpp/ripple/LedgerAcquire.cpp @@ -731,8 +731,25 @@ void LedgerAcquireMaster::logFailure(const uint256& hash) bool LedgerAcquireMaster::isFailure(const uint256& hash) { + time_t now = time(NULL); boost::mutex::scoped_lock sl(mLock); - return mRecentFailures.find(hash) != mRecentFailures.end(); + + std::map::iterator it = mRecentFailures.find(hash); + if (it == mRecentFailures.end()) + return false; + + if (it->second > now) + { + it->second = now; + return true; + } + + if ((it->second + 180) < now) + { + mRecentFailures.erase(it); + return false; + } + return true; } void LedgerAcquireMaster::sweep()