mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 18:22:57 +02:00
walletdb: don't automatically salvage when corruption is detected
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user