From f0c1fbb0981453ef1b44655fd2c50cf74132ab82 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sat, 11 Jul 2015 15:26:55 -0700 Subject: [PATCH] Use LedgerInfo hash in applyHeldTransactions --- src/ripple/app/ledger/impl/LedgerMaster.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ripple/app/ledger/impl/LedgerMaster.cpp b/src/ripple/app/ledger/impl/LedgerMaster.cpp index e1d4ab68b4..d0790eda1e 100644 --- a/src/ripple/app/ledger/impl/LedgerMaster.cpp +++ b/src/ripple/app/ledger/impl/LedgerMaster.cpp @@ -362,7 +362,7 @@ public: ScopedLockType sl (m_mutex); // Start with a mutable snapshot of the open ledger - auto const ledger = + auto const newOL = mCurrentLedger.getMutable(); int recovers = 0; @@ -386,7 +386,7 @@ public: #endif { - OpenView view(&*ledger); + OpenView view(&*newOL); for (auto const& it : mHeldTransactions) { ApplyFlags tepFlags = tapNONE; @@ -405,14 +405,16 @@ public: // it will become disputed in the consensus process, which // will cause it to be relayed. } - view.apply(*ledger); + view.apply(*newOL); } CondLog (recovers != 0, lsINFO, LedgerMaster) << "Recovered " << recovers << " held transactions"; // VFALCO TODO recreate the CanonicalTxSet object instead of resetting it - mHeldTransactions.reset (ledger->getHash ()); - mCurrentLedger.set (ledger); + // VFALCO NOTE The hash for an open ledger is undefined so + // we use something that is a reasonable substitute. + mHeldTransactions.reset (newOL->info().hash); + mCurrentLedger.set (newOL); } LedgerIndex getBuildingLedger ()