aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/salvage.cpp
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2020-06-15 14:37:29 -0400
committerAndrew Chow <achow101-github@achow101.com>2020-07-01 12:32:03 -0400
commit8f1bcf8b7b6e47c05f2e43dd98ec3505b888d8b3 (patch)
treeb0b8829b2b045b33537de2cc3c5a6c1661ab47fd /src/wallet/salvage.cpp
parentdbd7a91fdf3ff801fe5e4107e8346d0d6d11a899 (diff)
downloadbitcoin-8f1bcf8b7b6e47c05f2e43dd98ec3505b888d8b3.tar.xz
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.cpp5
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