aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2020-10-30 16:28:44 -0400
committerRussell Yanofsky <russ@yanofsky.org>2020-12-04 11:03:28 -0400
commit6a7a63644cd2fc56538d323cc0d5c1d7945247fd (patch)
tree77d735a95a4054bea3f12c05518c448e1a609edc /src/wallet
parent6ee9cbdd18a70894f89dd268c276d5eb47a34827 (diff)
refactor: Drop call to GetWalletEnv in wallet salvage code
No observable change in behavior. This just avoids a redundant environment lookup. Motivation is to be able to simplify the GetWalletEnv implementation in an upcoming commit.
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/salvage.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wallet/salvage.cpp b/src/wallet/salvage.cpp
index da5ca7858f..09a9ec68cd 100644
--- a/src/wallet/salvage.cpp
+++ b/src/wallet/salvage.cpp
@@ -32,8 +32,9 @@ bool RecoverDatabaseFile(const fs::path& file_path, bilingual_str& error, std::v
std::unique_ptr<WalletDatabase> database = MakeDatabase(file_path, options, status, error);
if (!database) return false;
- std::string filename;
- std::shared_ptr<BerkeleyEnvironment> env = GetWalletEnv(file_path, filename);
+ BerkeleyDatabase& berkeley_database = static_cast<BerkeleyDatabase&>(*database);
+ std::string filename = berkeley_database.Filename();
+ std::shared_ptr<BerkeleyEnvironment> env = berkeley_database.env;
if (!env->Open(error)) {
return false;