diff options
author | Andrew Chow <achow101-github@achow101.com> | 2020-05-08 18:44:21 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2020-05-25 12:59:22 -0400 |
commit | 8ebcbc85c652665b78dcfd2ad55fa67cafd42c73 (patch) | |
tree | 413e5c364282fdc3316554ca6046463ffa784f8e /src/wallet/db.h | |
parent | d321046f4bb4887742699c586755a21f3a2edbe1 (diff) |
walletdb: don't automatically salvage when corruption is detected
Diffstat (limited to 'src/wallet/db.h')
-rw-r--r-- | src/wallet/db.h | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/wallet/db.h b/src/wallet/db.h index 37f96a1a96..1151124da3 100644 --- a/src/wallet/db.h +++ b/src/wallet/db.h @@ -66,17 +66,7 @@ public: bool IsDatabaseLoaded(const std::string& db_filename) const { return m_databases.find(db_filename) != m_databases.end(); } fs::path Directory() const { return strPath; } - /** - * Verify that database file strFile is OK. If it is not, - * call the callback to try to recover. - * This must be called BEFORE strFile is opened. - * Returns true if strFile is OK. - */ - enum class VerifyResult { VERIFY_OK, - RECOVER_OK, - RECOVER_FAIL }; - typedef bool (*recoverFunc_type)(const fs::path& file_path, std::string& out_backup_filename); - VerifyResult Verify(const std::string& strFile, recoverFunc_type recoverFunc, std::string& out_backup_filename); + bool Verify(const std::string& strFile); /** * Salvage data from a file that Verify says is bad. * fAggressive sets the DB_AGGRESSIVE flag (see berkeley DB->verify() method documentation). @@ -253,7 +243,7 @@ public: /* verifies the database environment */ static bool VerifyEnvironment(const fs::path& file_path, bilingual_str& errorStr); /* verifies the database file */ - static bool VerifyDatabaseFile(const fs::path& file_path, std::vector<bilingual_str>& warnings, bilingual_str& errorStr, BerkeleyEnvironment::recoverFunc_type recoverFunc); + static bool VerifyDatabaseFile(const fs::path& file_path, bilingual_str& errorStr); template <typename K, typename T> bool Read(const K& key, T& value) |