diff --git a/src/cpp/ripple/LedgerConsensus.cpp b/src/cpp/ripple/LedgerConsensus.cpp index ce2446585..778412a56 100644 --- a/src/cpp/ripple/LedgerConsensus.cpp +++ b/src/cpp/ripple/LedgerConsensus.cpp @@ -1197,6 +1197,12 @@ void LedgerConsensus::accept(SHAMap::ref set, LoadEvent::pointer) assert(set->getHash() == mOurPosition->getCurrentHash()); uint32 closeTime = roundCloseTime(mOurPosition->getCloseTime()); + bool closeTimeCorrect = true; + if (closeTime == 0) + { // we agreed to disagree + closeTimeCorrect = false; + closeTime = mPreviousLedger->getCloseTimeNC() + 1; + } cLog(lsDEBUG) << "Report: Prop=" << (mProposing ? "yes" : "no") << " val=" << (mValidating ? "yes" : "no") << " corLCL=" << (mHaveCorrectLCL ? "yes" : "no") << " fail="<< (mConsensusFail ? "yes" : "no"); @@ -1215,7 +1221,6 @@ void LedgerConsensus::accept(SHAMap::ref set, LoadEvent::pointer) boost::shared_ptr acctNodes = newLCL->peekAccountStateMap()->disarmDirty(); boost::shared_ptr txnNodes = newLCL->peekTransactionMap()->disarmDirty(); - // write out dirty nodes (temporarily done here) Most come before setAccepted int fc; while ((fc = SHAMap::flushDirty(*acctNodes, 256, hotACCOUNT_NODE, newLCL->getLedgerSeq())) > 0) @@ -1223,13 +1228,6 @@ void LedgerConsensus::accept(SHAMap::ref set, LoadEvent::pointer) while ((fc = SHAMap::flushDirty(*txnNodes, 256, hotTRANSACTION_NODE, newLCL->getLedgerSeq())) > 0) { cLog(lsTRACE) << "Flushed " << fc << " dirty transaction nodes"; } - bool closeTimeCorrect = true; - if (closeTime == 0) - { // we agreed to disagree - closeTimeCorrect = false; - closeTime = mPreviousLedger->getCloseTimeNC() + 1; - } - cLog(lsDEBUG) << "Report: NewL = " << newLCL->getHash() << ":" << newLCL->getLedgerSeq(); newLCL->setAccepted(closeTime, mCloseResolution, closeTimeCorrect);