diff --git a/src/Application.cpp b/src/Application.cpp index 72fe6ca1b..59f80e2e4 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -222,12 +222,22 @@ void Application::loadOldLedger() cLog(lsINFO) << "Loading ledger " << lastLedger->getHash() << " seq:" << lastLedger->getLedgerSeq(); + if (lastLedger->getAccountHash().isZero()) + { + cLog(lsFATAL) << "Ledger is empty."; + assert(false); + exit(-1); + } + if (!lastLedger->walkLedger()) { cLog(lsFATAL) << "Ledger is missing nodes."; exit(-1); } + assert(lastLedger->getAccountHash() == lastLedger->peekAccountStateMap()->getHash()); + assert(lastLedger->getTransHash() == lastLedger->peekTransactionMap()->getHash()); + Ledger::pointer openLedger = boost::make_shared(false, boost::ref(*lastLedger)); mMasterLedger.switchLedgers(lastLedger, openLedger); mNetOps.setLastCloseTime(lastLedger->getCloseTimeNC());