From e5573950727a30cdc25c0a0f3f7af838203ccdb2 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Fri, 7 Sep 2012 10:47:15 -0700 Subject: [PATCH] Fix the bug causing ledgers to close immediately even without transactions. Fix a bug that could cause the network to proceed without a consensus. --- src/LedgerConsensus.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/LedgerConsensus.cpp b/src/LedgerConsensus.cpp index ebe2b08794..5130d398c5 100644 --- a/src/LedgerConsensus.cpp +++ b/src/LedgerConsensus.cpp @@ -491,7 +491,7 @@ void LedgerConsensus::statePreClose() } else { - sinceClose = theApp->getOPs().getLastCloseTime(); + sinceClose = 1000 * (theApp->getOPs().getCloseTimeNC() - theApp->getOPs().getLastCloseTime()); idleInterval = LEDGER_IDLE_INTERVAL; } @@ -517,7 +517,7 @@ void LedgerConsensus::stateEstablish() if (haveConsensus()) Log(lsINFO) << "We have TX consensus but not CT consensus"; } - if (haveConsensus()) + else if (haveConsensus()) { Log(lsINFO) << "Converge cutoff (" << mPeerPositions.size() << " participants)"; mState = lcsFINISHED; @@ -638,7 +638,7 @@ void LedgerConsensus::updateOurPositions() for (std::map::iterator it = closeTimes.begin(), end = closeTimes.end(); it != end; ++it) { - Log(lsINFO) << "CCTime: " << it->first << " has " << it->second << " out of " << thresh; + Log(lsINFO) << "CCTime: " << it->first << " has " << it->second << ", " << thresh << " required"; if (it->second > thresh) { Log(lsINFO) << "Close time consensus reached: " << it->first;