From 1c854f9c730220eec413b06eef30a4dfb4d51121 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Mon, 4 Jun 2012 21:52:04 -0700 Subject: [PATCH 1/2] Typo. --- src/LedgerConsensus.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/LedgerConsensus.cpp b/src/LedgerConsensus.cpp index 91a393a05c..5209ba437c 100644 --- a/src/LedgerConsensus.cpp +++ b/src/LedgerConsensus.cpp @@ -625,7 +625,7 @@ void LedgerConsensus::applyTransactions(SHAMap::pointer set, Ledger::pointer led item = set->peekNextItem(item->getTag()); } - int successes = 0; + int successes; do { successes = 0; @@ -701,7 +701,15 @@ void LedgerConsensus::accept(SHAMap::pointer set) newOL->addJson(p, LEDGER_JSON_DUMP_TXNS | LEDGER_JSON_DUMP_STATE); ssw.write(std::cerr, p); } + if (1) + { + Log(lsTRACE) << "current ledger"; + Json::Value p; + theApp->getMasterLedger().getCurrentLedger()->addJson(p, LEDGER_JSON_DUMP_TXNS | LEDGER_JSON_DUMP_STATE); + ssw.write(std::cerr, p); + } #endif + ScopedLock sl = theApp->getMasterLedger().getLock(); applyTransactions(theApp->getMasterLedger().getCurrentLedger()->peekTransactionMap(), @@ -712,7 +720,7 @@ void LedgerConsensus::accept(SHAMap::pointer set) #ifdef DEBUG if (1) { - Log(lsTRACE) << "newOL after transactions"; + Log(lsTRACE) << "newOL after current ledger transactions"; Json::Value p; newOL->addJson(p, LEDGER_JSON_DUMP_TXNS | LEDGER_JSON_DUMP_STATE); ssw.write(std::cerr, p); From 79cc39f9028aad4371c91a17bba799028539d2a4 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Tue, 5 Jun 2012 04:00:25 -0700 Subject: [PATCH 2/2] Tweak. --- src/LedgerConsensus.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/LedgerConsensus.cpp b/src/LedgerConsensus.cpp index 5209ba437c..dd787bafb2 100644 --- a/src/LedgerConsensus.cpp +++ b/src/LedgerConsensus.cpp @@ -155,9 +155,9 @@ bool LCTransaction::updatePosition(int seconds) // To prevent avalanche stalls, we increase the needed weight slightly over time bool newPosition; - if (seconds <= LEDGER_CONVERGE) newPosition = weight >= AV_MIN_CONSENSUS; - else if (seconds >= LEDGER_FORCE_CONVERGE) newPosition = weight >= AV_MAX_CONSENSUS; - else newPosition = weight >= AV_AVG_CONSENSUS; + if (seconds <= LEDGER_CONVERGE) newPosition = weight > AV_MIN_CONSENSUS; + else if (seconds >= LEDGER_FORCE_CONVERGE) newPosition = weight > AV_MAX_CONSENSUS; + else newPosition = weight > AV_AVG_CONSENSUS; if (newPosition == mOurPosition) return false; mOurPosition = newPosition;