wallet: Add trailing wallet.dat when detecting duplicate wallet if it's a directory.
Github-Pull: #14552
Rebased-From: 15c93f0
This commit is contained in:
parent
3cf3002e9e
commit
5847e62f19
1 changed files with 11 additions and 0 deletions
|
@ -77,6 +77,17 @@ 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();
|
||||
}
|
||||
|
||||
BerkeleyEnvironment* GetWalletEnv(const fs::path& wallet_path, std::string& database_filename)
|
||||
{
|
||||
fs::path env_directory;
|
||||
SplitWalletPath(wallet_path, env_directory, database_filename);
|
||||
LOCK(cs_db);
|
||||
auto env = g_dbenvs.find(env_directory.string());
|
||||
if (env == g_dbenvs.end()) return false;
|
||||
auto database = env->second.lock();
|
||||
return database && database->IsDatabaseLoaded(database_filename);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue