Emergency fix: Sanely handle taking a position we previously failed to acquire.

This commit is contained in:
JoelKatz
2013-04-05 09:57:24 -07:00
parent 7131564eb1
commit 04d48a6d21

View File

@@ -395,10 +395,17 @@ void LedgerConsensus::mapComplete(const uint256& hash, SHAMap::ref map, bool acq
}
assert(hash == map->getHash());
boost::unordered_map<uint256, SHAMap::pointer>::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()))