core: add --db-salvage command line flag

Use to load the database when the primary meta page is corrupted
This commit is contained in:
moneromooo-monero
2017-07-30 23:59:52 +01:00
parent 181a008aa3
commit c6e200a8ab
4 changed files with 14 additions and 1 deletions
+1 -1
View File
@@ -213,7 +213,7 @@ const std::string lmdb_error(const std::string& error_string, int mdb_res)
inline void lmdb_db_open(MDB_txn* txn, const char* name, int flags, MDB_dbi& dbi, const std::string& error_string)
{
if (auto res = mdb_dbi_open(txn, name, flags, &dbi))
throw0(cryptonote::DB_OPEN_FAILURE(lmdb_error(error_string + " : ", res).c_str()));
throw0(cryptonote::DB_OPEN_FAILURE((lmdb_error(error_string + " : ", res) + std::string(" - you may want to start with --db-salvage")).c_str()));
}