From 21693ff0b743f094e73111a81c1c86e2622d937c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Barbosa?= Date: Fri, 28 Sep 2018 12:50:04 +0100 Subject: wallet: Add WalletLocation utility class Github-Pull: #14350 Rebased-From: 01a4c09 --- src/wallet/walletutil.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/wallet/walletutil.cpp') 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; +} -- cgit v1.2.3