diff options
author | Andrew Chow <achow101-github@achow101.com> | 2020-06-15 14:37:29 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2020-07-01 12:32:03 -0400 |
commit | 8f1bcf8b7b6e47c05f2e43dd98ec3505b888d8b3 (patch) | |
tree | b0b8829b2b045b33537de2cc3c5a6c1661ab47fd /src/wallet/salvage.cpp | |
parent | dbd7a91fdf3ff801fe5e4107e8346d0d6d11a899 (diff) |
walletdb: Combine VerifyDatabaseFile and VerifyEnvironment
Combine these two functions into a single Verify function that is a
member of WalletDatabase. Additionally, these are no longer static.
Diffstat (limited to 'src/wallet/salvage.cpp')
-rw-r--r-- | src/wallet/salvage.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wallet/salvage.cpp b/src/wallet/salvage.cpp index d42950ee42..e6e62332c0 100644 --- a/src/wallet/salvage.cpp +++ b/src/wallet/salvage.cpp @@ -20,6 +20,11 @@ bool RecoverDatabaseFile(const fs::path& file_path) std::string filename; std::shared_ptr<BerkeleyEnvironment> env = GetWalletEnv(file_path, filename); + if (!env->Open(true /* retry */)) { + tfm::format(std::cerr, "Error initializing wallet database environment %s!", env->Directory()); + return false; + } + // Recovery procedure: // move wallet file to walletfilename.timestamp.bak // Call Salvage with fAggressive=true to |