diff options
author | Andrew Chow <achow101-github@achow101.com> | 2020-05-07 14:30:04 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2020-07-13 11:00:54 -0400 |
commit | d0ea9bab2804928c9f40def61fd99064d2d8f9b8 (patch) | |
tree | ee3edf72d9ff4f22542850bb66fc3fd667288e33 /src/wallet/salvage.cpp | |
parent | 160800ac105568a59e343411d21a90e9530e1b9e (diff) |
walletdb: Don't remove database transaction logs and instead error
Instead of removing the database transaction logs and retrying the
wallet loading, just return an error message to the user. Additionally,
specifically for DB_RUNRECOVERY, notify the user that this could be due
to different BDB versions. This error is pretty much only caused by
compiling with a newer version of BDB and then trying to open the wallet
with a version compiled with an older version of BDB.
Diffstat (limited to 'src/wallet/salvage.cpp')
-rw-r--r-- | src/wallet/salvage.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wallet/salvage.cpp b/src/wallet/salvage.cpp index e6e62332c0..af57210f01 100644 --- a/src/wallet/salvage.cpp +++ b/src/wallet/salvage.cpp @@ -5,6 +5,7 @@ #include <fs.h> #include <streams.h> +#include <util/translation.h> #include <wallet/salvage.h> #include <wallet/wallet.h> #include <wallet/walletdb.h> @@ -20,8 +21,9 @@ 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()); + bilingual_str open_err; + if (!env->Open(open_err)) { + tfm::format(std::cerr, "%s\n", open_err.original); return false; } |