From 04d48a6d2139257a07e187101f61c0805043c9a3 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Fri, 5 Apr 2013 09:57:24 -0700 Subject: [PATCH] Emergency fix: Sanely handle taking a position we previously failed to acquire. --- src/cpp/ripple/LedgerConsensus.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/cpp/ripple/LedgerConsensus.cpp b/src/cpp/ripple/LedgerConsensus.cpp index 3ed93cbf9b..f7ebf30fc9 100644 --- a/src/cpp/ripple/LedgerConsensus.cpp +++ b/src/cpp/ripple/LedgerConsensus.cpp @@ -395,10 +395,17 @@ void LedgerConsensus::mapComplete(const uint256& hash, SHAMap::ref map, bool acq } assert(hash == map->getHash()); + boost::unordered_map::iterator it = mAcquired.find(hash); if (mAcquired.find(hash) != mAcquired.end()) { - mAcquiring.erase(hash); - return; // we already have this map + if (it->second) + { + mAcquiring.erase(hash); + return; // we already have this map + } + + // We previously failed to acquire this map, now we have it + mAcquired.erase(hash); } if (mOurPosition && (!mOurPosition->isBowOut()) && (hash != mOurPosition->getCurrentHash()))