Fix a bug where a node doesn't get a chance to finish acquiring a TX set

before all nodes forget it because they're done with it, leaving a node
behind the consensus.
This commit is contained in:
JoelKatz
2012-12-27 20:25:12 -08:00
parent 9f072fcac6
commit a169167030
3 changed files with 27 additions and 1 deletions

View File

@@ -827,7 +827,6 @@ SHAMap::pointer LedgerConsensus::getTransactionTree(const uint256& hash, bool do
SHAMap::pointer currentMap = theApp->getLedgerMaster().getCurrentLedger()->peekTransactionMap();
if (currentMap->getHash() == hash)
{
cLog(lsINFO) << "node proposes our open transaction set";
currentMap = currentMap->snapShot(false);
mapComplete(hash, currentMap, false);
return currentMap;
@@ -1193,6 +1192,9 @@ uint32 LedgerConsensus::roundCloseTime(uint32 closeTime)
void LedgerConsensus::accept(SHAMap::ref set, LoadEvent::pointer)
{
if (set->getHash().isNonZero())
theApp->getOPs().takePosition(mPreviousLedger->getLedgerSeq(), set);
boost::recursive_mutex::scoped_lock masterLock(theApp->getMasterLock());
assert(set->getHash() == mOurPosition->getCurrentHash());