diff --git a/src/wallet/bdb.h b/src/wallet/bdb.h --- a/src/wallet/bdb.h +++ b/src/wallet/bdb.h @@ -63,8 +63,6 @@ } fs::path Directory() const { return strPath; } - bool Verify(const std::string &strFile); - bool Open(bilingual_str &error); void Close(); void Flush(bool fShutdown); diff --git a/src/wallet/bdb.cpp b/src/wallet/bdb.cpp --- a/src/wallet/bdb.cpp +++ b/src/wallet/bdb.cpp @@ -261,15 +261,6 @@ fMockDb = true; } -bool BerkeleyEnvironment::Verify(const std::string &strFile) { - LOCK(cs_db); - assert(mapFileUseCount.count(strFile) == 0); - - Db db(dbenv.get(), 0); - int result = db.verify(strFile.c_str(), nullptr, nullptr, 0); - return result == 0; -} - BerkeleyBatch::SafeDbt::SafeDbt() { m_dbt.set_flags(DB_DBT_MALLOC); } @@ -314,7 +305,12 @@ } if (fs::exists(file_path)) { - if (!env->Verify(strFile)) { + LOCK(cs_db); + assert(env->mapFileUseCount.count(strFile) == 0); + + Db db(env->dbenv.get(), 0); + int result = db.verify(strFile.c_str(), nullptr, nullptr, 0); + if (result != 0) { errorStr = strprintf(_("%s corrupt. Try using the wallet tool " "bitcoin-wallet to salvage or restoring a backup."),