Fix a bug that could cause an idle ledger to spend insufficient time

establishing a consensus.
This commit is contained in:
JoelKatz
2012-08-29 16:01:30 -07:00
parent ed709e0ccc
commit 774110eef9

View File

@@ -200,6 +200,8 @@ LedgerConsensus::LedgerConsensus(const uint256& prevLCLHash, const Ledger::point
mCurrentMSeconds(0), mClosePercent(0), mHaveCloseTimeConsensus(false)
{
mValSeed = theConfig.VALIDATION_SEED;
mConsensusStartTime = boost::posix_time::microsec_clock::universal_time();
Log(lsDEBUG) << "Creating consensus object";
Log(lsTRACE) << "LCL:" << previousLedger->getHash().GetHex() <<", ct=" << closeTime;
mPreviousProposers = theApp->getOPs().getPreviousProposers();
@@ -491,8 +493,8 @@ void LedgerConsensus::timerEntry()
Log(lsINFO) << "Need consensus ledger " << mPrevLedgerHash.GetHex();
}
mCurrentMSeconds = (mCloseTime == 0) ? 0 :
(boost::posix_time::microsec_clock::universal_time() - mConsensusStartTime).total_milliseconds();
mCurrentMSeconds =
(boost::posix_time::microsec_clock::universal_time() - mConsensusStartTime).total_milliseconds();
mClosePercent = mCurrentMSeconds * 100 / mPreviousMSeconds;
switch (mState)