From 288b4ffb6b291f0466d513ff3c40af6758ca7c88 Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Tue, 28 Jul 2020 19:25:14 -0400 Subject: Remove WalletLocation class This removes a source of complexity and indirection that makes it harder to understand path checking code. Path checks will be simplified in upcoming commits. There is no change in behavior in this commit other than a slightly more descriptive error message in `loadwallet` if the default "" wallet can't be found. (The error message is improved more in upcoming commit "wallet: Remove path checking code from loadwallet RPC".) --- src/wallet/salvage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/wallet/salvage.cpp') diff --git a/src/wallet/salvage.cpp b/src/wallet/salvage.cpp index 934e3d5c86..96fba21339 100644 --- a/src/wallet/salvage.cpp +++ b/src/wallet/salvage.cpp @@ -123,7 +123,7 @@ bool RecoverDatabaseFile(const fs::path& file_path, bilingual_str& error, std::v } DbTxn* ptxn = env->TxnBegin(); - CWallet dummyWallet(nullptr, WalletLocation(), CreateDummyWalletDatabase()); + CWallet dummyWallet(nullptr, "", CreateDummyWalletDatabase()); for (KeyValPair& row : salvagedData) { /* Filter for only private key type KV pairs to be added to the salvaged wallet */ -- cgit v1.2.3 From 7bf6dfbb484adfda3b8df26ee3e2ebda239dd263 Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Tue, 4 Aug 2020 21:16:48 -0400 Subject: wallet: Remove path checking code from bitcoin-wallet tool This commit does not change behavior except for error messages which now include more complete information. --- src/wallet/salvage.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/wallet/salvage.cpp') diff --git a/src/wallet/salvage.cpp b/src/wallet/salvage.cpp index 96fba21339..225b975067 100644 --- a/src/wallet/salvage.cpp +++ b/src/wallet/salvage.cpp @@ -23,6 +23,13 @@ static bool KeyFilter(const std::string& type) bool RecoverDatabaseFile(const fs::path& file_path, bilingual_str& error, std::vector& warnings) { + DatabaseOptions options; + DatabaseStatus status; + options.require_existing = true; + options.verify = false; + std::unique_ptr database = MakeDatabase(file_path, options, status, error); + if (!database) return false; + std::string filename; std::shared_ptr env = GetWalletEnv(file_path, filename); -- cgit v1.2.3