Cleanup resynch logic.

This commit is contained in:
JoelKatz
2012-08-01 14:38:29 -07:00
parent d25fc9c593
commit ee3562a9a9
3 changed files with 5 additions and 4 deletions

View File

@@ -888,11 +888,10 @@ void LedgerConsensus::accept(SHAMap::pointer set)
ssw.write(Log(lsTRACE).ref(), p);
}
#endif
// FIXME: If necessary, change state to TRACKING/FULL
}
void LedgerConsensus::endConsensus()
{
theApp->getOPs().endConsensus();
theApp->getOPs().endConsensus(mHaveCorrectLCL);
}
// vim:ts=4

View File

@@ -643,7 +643,7 @@ void NetworkOPs::mapComplete(const uint256& hash, SHAMap::pointer map)
mConsensus->mapComplete(hash, map, true);
}
void NetworkOPs::endConsensus()
void NetworkOPs::endConsensus(bool correctLCL)
{
uint256 deadLedger = theApp->getMasterLedger().getClosedLedger()->getParentHash();
Log(lsTRACE) << "Ledger " << deadLedger.GetHex() << " is now dead";
@@ -655,6 +655,8 @@ void NetworkOPs::endConsensus()
(*it)->cycleStatus();
}
mConsensus = boost::shared_ptr<LedgerConsensus>();
if (correctLCL && (mMode == omCONNECTED))
setMode(omTRACKING);
}
void NetworkOPs::setMode(OperatingMode om)

View File

@@ -184,7 +184,7 @@ public:
void switchLastClosedLedger(Ledger::pointer newLedger); // Used for the "jump" case
bool checkLastClosedLedger(const std::vector<Peer::pointer>&, uint256& networkClosed);
int beginConsensus(const uint256& networkClosed, Ledger::pointer closingLedger);
void endConsensus();
void endConsensus(bool correctLCL);
void setStateTimer();
void newLCL(int proposers, int convergeTime, const uint256& ledgerHash);
int getPreviousProposers() { return mLastCloseProposers; }