From 3bc0f78b0cd19ba29af7945a251f4a31d7383964 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Sun, 15 Jul 2012 23:50:17 -0700 Subject: [PATCH] Bugfix. --- src/LedgerTiming.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/LedgerTiming.cpp b/src/LedgerTiming.cpp index bc03d3c451..e9f2796148 100644 --- a/src/LedgerTiming.cpp +++ b/src/LedgerTiming.cpp @@ -99,12 +99,13 @@ bool ContinuousLedgerTiming::haveConsensus( int ContinuousLedgerTiming::getNextLedgerTimeResolution(int previousResolution, bool previousAgree, int ledgerSeq) { assert(ledgerSeq); + assert(previousAgree); // TEMPORARY if ((!previousAgree) && ((ledgerSeq % LEDGER_RES_DECREASE) == 0)) { // reduce resolution int i = 1; while (LedgerTimeResolution[i] != previousResolution) ++i; - return LedgerTimeResolution[i - 1]; + return LedgerTimeResolution[i + 1]; } if ((previousAgree) && ((ledgerSeq % LEDGER_RES_INCREASE) == 0)) @@ -112,7 +113,7 @@ int ContinuousLedgerTiming::getNextLedgerTimeResolution(int previousResolution, int i = 1; while (LedgerTimeResolution[i] != previousResolution) ++i; - return LedgerTimeResolution[i + 1]; + return LedgerTimeResolution[i - 1]; } return previousResolution;