aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/db.cpp3
-rw-r--r--src/wallet/db.h1
2 files changed, 2 insertions, 2 deletions
diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp
index f7ffd0d6bf..2d841ff8fd 100644
--- a/src/wallet/db.cpp
+++ b/src/wallet/db.cpp
@@ -80,8 +80,7 @@ bool IsWalletLoaded(const fs::path& wallet_path)
LOCK(cs_db);
auto env = g_dbenvs.find(env_directory.string());
if (env == g_dbenvs.end()) return false;
- auto db = env->second.m_databases.find(database_filename);
- return db != env->second.m_databases.end();
+ return env->second.IsDatabaseLoaded(database_filename);
}
BerkeleyEnvironment* GetWalletEnv(const fs::path& wallet_path, std::string& database_filename)
diff --git a/src/wallet/db.h b/src/wallet/db.h
index dd549bc463..6af37c12cd 100644
--- a/src/wallet/db.h
+++ b/src/wallet/db.h
@@ -56,6 +56,7 @@ public:
void MakeMock();
bool IsMock() const { return fMockDb; }
bool IsInitialized() const { return fDbEnvInit; }
+ bool IsDatabaseLoaded(const std::string& db_filename) const { return m_databases.find(db_filename) != m_databases.end(); }
fs::path Directory() const { return strPath; }
/**