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/wallettool.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/wallettool.cpp')
-rw-r--r-- | src/wallet/wallettool.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/wallet/wallettool.cpp b/src/wallet/wallettool.cpp index 77ed6beb5d..8a45d81456 100644 --- a/src/wallet/wallettool.cpp +++ b/src/wallet/wallettool.cpp @@ -112,7 +112,7 @@ static bool SalvageWallet(const fs::path& path) // Initialize the environment before recovery bilingual_str error_string; try { - WalletBatch::VerifyEnvironment(path, error_string); + database->Verify(error_string); } catch (const fs::filesystem_error& e) { error_string = Untranslated(strprintf("Error loading wallet. %s", fsbridge::get_filesystem_error_message(e))); } @@ -140,11 +140,6 @@ bool ExecuteWalletToolFunc(const std::string& command, const std::string& name) tfm::format(std::cerr, "Error: no wallet file at %s\n", name); return false; } - bilingual_str error; - if (!WalletBatch::VerifyEnvironment(path, error)) { - tfm::format(std::cerr, "%s\nError loading %s. Is wallet being used by other process?\n", error.original, name); - return false; - } if (command == "info") { std::shared_ptr<CWallet> wallet_instance = LoadWallet(name, path); |