Skip to content

Commit 6a7a636

Browse files
committed
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.
1 parent 6ee9cbd commit 6a7a636

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/wallet/salvage.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ bool RecoverDatabaseFile(const fs::path& file_path, bilingual_str& error, std::v
3232
std::unique_ptr<WalletDatabase> database = MakeDatabase(file_path, options, status, error);
3333
if (!database) return false;
3434

35-
std::string filename;
36-
std::shared_ptr<BerkeleyEnvironment> env = GetWalletEnv(file_path, filename);
35+
BerkeleyDatabase& berkeley_database = static_cast<BerkeleyDatabase&>(*database);
36+
std::string filename = berkeley_database.Filename();
37+
std::shared_ptr<BerkeleyEnvironment> env = berkeley_database.env;
3738

3839
if (!env->Open(error)) {
3940
return false;

0 commit comments

Comments
 (0)