From 22237e58ab15a02b257f072c854101dc9f32b9ca Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Mon, 13 Aug 2012 22:27:29 -0700 Subject: [PATCH] Check for network condition during idle time. Switch LCL if needed. --- src/LedgerConsensus.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/LedgerConsensus.cpp b/src/LedgerConsensus.cpp index a2888f190a..6b56b66402 100644 --- a/src/LedgerConsensus.cpp +++ b/src/LedgerConsensus.cpp @@ -224,7 +224,7 @@ LedgerConsensus::LedgerConsensus(const uint256& prevLCLHash, Ledger::pointer pre } else { - Log(lsINFO) << "Entering consensus process, proposing"; + Log(lsINFO) << "Entering consensus process, watching"; mHaveCorrectLCL = true; mProposing = mValidating = false; } @@ -249,6 +249,9 @@ void LedgerConsensus::checkLCL() mPrevLedgerHash = netLgr; mAcquiringLedger = theApp->getMasterLedgerAcquire().findCreate(mPrevLedgerHash); std::vector peerList = theApp->getConnectionPool().getPeerVector(); + mHaveCorrectLCL = false; + mProposing = false; + mValidating = false; bool found = false; for (std::vector::const_iterator it = peerList.begin(), end = peerList.end(); it != end; ++it) if ((*it)->hasLedger(mPrevLedgerHash)) @@ -418,6 +421,8 @@ void LedgerConsensus::statePreClose() statusChange(newcoin::neCLOSING_LEDGER, *mPreviousLedger); takeInitialPosition(*theApp->getMasterLedger().closeLedger()); } + else + checkLCL(); } void LedgerConsensus::stateEstablish()