From 0f51774f58612a4971cb9b4929fb234da4d87d49 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Mon, 13 Aug 2012 15:10:38 -0700 Subject: [PATCH] Some paranoid extra checks. --- src/LedgerConsensus.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/LedgerConsensus.cpp b/src/LedgerConsensus.cpp index 1cb3d288cf..7d9f1c3d6c 100644 --- a/src/LedgerConsensus.cpp +++ b/src/LedgerConsensus.cpp @@ -544,6 +544,8 @@ void LedgerConsensus::updateOurPositions() ++thresh; } thresh = thresh * neededWeight / 100; + if (thresh == 0) + thresh = 1; for (std::map::iterator it = closeTimes.begin(), end = closeTimes.end(); it != end; ++it) { @@ -553,6 +555,7 @@ void LedgerConsensus::updateOurPositions() Log(lsINFO) << "Close time consensus reached: " << closeTime; mHaveCloseTimeConsensus = true; closeTime = it->first; + thresh = it->second; } } }