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.
This commit is contained in:
Russell Yanofsky
2020-10-30 16:28:44 -04:00
parent 6ee9cbdd18
commit 6a7a63644c

View File

@@ -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;