From bdd1a9589f3f19b95f1298d0b342f19eb21a1ef3 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Sat, 11 May 2013 17:29:19 -0700 Subject: [PATCH] Detect broken accttx databases. --- src/cpp/ripple/UpdateTables.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cpp/ripple/UpdateTables.cpp b/src/cpp/ripple/UpdateTables.cpp index 6db98d772..5be595b2f 100644 --- a/src/cpp/ripple/UpdateTables.cpp +++ b/src/cpp/ripple/UpdateTables.cpp @@ -107,6 +107,13 @@ void Application::updateTables(bool ldbImport) assert(!schemaHas(theApp->getTxnDB(), "AccountTransactions", 0, "foobar")); addTxnSeqField(); + if (schemaHas(theApp->getTxnDB(), "AccountTransactions", 0, "PRIMARY")) + { + Log(lsFATAL) << "AccountTransactions database should not have a primary key"; + StopSustain(); + exit(1); + } + #ifdef USE_LEVELDB if (theApp->getHashedObjectStore().isLevelDB()) { @@ -123,6 +130,7 @@ void Application::updateTables(bool ldbImport) { Log(lsWARNING) << "SQLite hashnode database exists. Please either remove or import"; Log(lsWARNING) << "To import, start with the '--import' option. Otherwise, remove hashnode.db"; + StopSustain(); exit(1); } }