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> | 2018-10-25 11:53:17 +0100 |
commit | 01a4c095c87500650663341533f000c6b613e9da (patch) | |
tree | b559b0826ae96da3b93c12b5940e14cb6ea2d4b0 /src/wallet/walletutil.cpp | |
parent | 613fc95ee4ead5962e960137e694aec5888e2680 (diff) |
wallet: Add WalletLocation utility class
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 c0c9afe13e..5d236d73e1 100644 --- a/src/wallet/walletutil.cpp +++ b/src/wallet/walletutil.cpp @@ -75,3 +75,14 @@ std::vector<fs::path> ListWalletDir() return paths; } + +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; +} |