From 40b87e915764733d81d23aeddd5b21af59cd87b2 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Sun, 30 Dec 2012 23:48:53 -0800 Subject: [PATCH] Fix a bug that would cause the server to exit the "need network ledger" state prematurely. --- src/cpp/ripple/LedgerConsensus.cpp | 4 ++-- src/cpp/ripple/NetworkOPs.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cpp/ripple/LedgerConsensus.cpp b/src/cpp/ripple/LedgerConsensus.cpp index 0633269129..c386f62b39 100644 --- a/src/cpp/ripple/LedgerConsensus.cpp +++ b/src/cpp/ripple/LedgerConsensus.cpp @@ -425,8 +425,8 @@ void LedgerConsensus::handleLCL(const uint256& lclHash) cLog(lsINFO) << "Have the consensus ledger " << mPrevLedgerHash; mHaveCorrectLCL = true; - mAcquiringLedger.reset(); - theApp->getOPs().clearNeedNetworkLedger(); + if (mAcquiringLedger->isComplete()) + theApp->getOPs().clearNeedNetworkLedger(); mCloseResolution = ContinuousLedgerTiming::getNextLedgerTimeResolution( mPreviousLedger->getCloseResolution(), mPreviousLedger->getCloseAgree(), mPreviousLedger->getLedgerSeq() + 1); diff --git a/src/cpp/ripple/NetworkOPs.cpp b/src/cpp/ripple/NetworkOPs.cpp index 327d165280..fa775e6788 100644 --- a/src/cpp/ripple/NetworkOPs.cpp +++ b/src/cpp/ripple/NetworkOPs.cpp @@ -770,6 +770,7 @@ bool NetworkOPs::checkLastClosedLedger(const std::vector& peerLis } return true; } + clearNeedNetworkLedger(); consensus = mAcquiringLedger->getLedger(); }