Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/walletutil.cpp
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | std::vector<fs::path> ListWalletDir() { | ||||
return paths; | return paths; | ||||
} | } | ||||
WalletLocation::WalletLocation(const std::string &name) | WalletLocation::WalletLocation(const std::string &name) | ||||
: m_name(name), m_path(fs::absolute(name, GetWalletDir())) {} | : m_name(name), m_path(fs::absolute(name, GetWalletDir())) {} | ||||
bool WalletLocation::Exists() const { | bool WalletLocation::Exists() const { | ||||
return fs::symlink_status(m_path).type() != fs::file_not_found; | fs::path path = m_path; | ||||
// For the default wallet, check specifically for the wallet.dat file | |||||
if (m_name.empty()) { | |||||
path = fs::absolute("wallet.dat", m_path); | |||||
} | |||||
return fs::symlink_status(path).type() != fs::file_not_found; | |||||
} | } |