From debe1b47410348b06bb988a6352cb92362d7e084 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Mon, 15 Oct 2012 04:13:26 -0700 Subject: [PATCH] Check ledger sanity. --- src/Application.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Application.cpp b/src/Application.cpp index 59f80e2e4..ec56e6b91 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -235,8 +235,11 @@ void Application::loadOldLedger() exit(-1); } - assert(lastLedger->getAccountHash() == lastLedger->peekAccountStateMap()->getHash()); - assert(lastLedger->getTransHash() == lastLedger->peekTransactionMap()->getHash()); + if (!lastLedger->assertSane()) + { + cLog(lsFATAL) << "Ledger is not sane."; + exit(-1); + } Ledger::pointer openLedger = boost::make_shared(false, boost::ref(*lastLedger)); mMasterLedger.switchLedgers(lastLedger, openLedger);