diff options
author | João Barbosa <joao.paulo.barbosa@gmail.com> | 2018-09-28 12:50:04 +0100 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2019-03-11 21:54:44 +0000 |
commit | 21693ff0b743f094e73111a81c1c86e2622d937c (patch) | |
tree | 9b85620bce2b92692d56426aaf57db3ae2e10fa3 /src/wallet/walletutil.cpp | |
parent | 1c98a758d0f43f12d600731373758303cefe7cd7 (diff) | |
download | bitcoin-21693ff0b743f094e73111a81c1c86e2622d937c.tar.xz |
wallet: Add WalletLocation utility class
Github-Pull: #14350
Rebased-From: 01a4c09
Diffstat (limited to 'src/wallet/walletutil.cpp')
-rw-r--r-- | src/wallet/walletutil.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/wallet/walletutil.cpp b/src/wallet/walletutil.cpp index 34c76ec4c4..064885ed49 100644 --- a/src/wallet/walletutil.cpp +++ b/src/wallet/walletutil.cpp @@ -25,3 +25,14 @@ fs::path GetWalletDir() return path; } + +WalletLocation::WalletLocation(const std::string& name) + : m_name(name) + , m_path(fs::absolute(name, GetWalletDir())) +{ +} + +bool WalletLocation::Exists() const +{ + return fs::symlink_status(m_path).type() != fs::file_not_found; +} |