aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/api/wallet_manager.cpp
diff options
context:
space:
mode:
authorJacob Brydolf <jacob@brydolf.net>2016-10-30 15:34:50 +0100
committerJacob Brydolf <jacob@brydolf.net>2016-10-30 15:34:50 +0100
commit43ec2d002abd18ae2acc44399f279966c835d937 (patch)
tree3ebeb8176ebe22b98cdc79c4baac889a846f5e7f /src/wallet/api/wallet_manager.cpp
parentMerge pull request #1270 (diff)
downloadmonero-43ec2d002abd18ae2acc44399f279966c835d937.tar.xz
Wallet API: added walletExists logic
Diffstat (limited to '')
-rw-r--r--src/wallet/api/wallet_manager.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/wallet/api/wallet_manager.cpp b/src/wallet/api/wallet_manager.cpp
index b8500aae3..d2395ace1 100644
--- a/src/wallet/api/wallet_manager.cpp
+++ b/src/wallet/api/wallet_manager.cpp
@@ -81,6 +81,12 @@ bool WalletManagerImpl::closeWallet(Wallet *wallet)
bool WalletManagerImpl::walletExists(const std::string &path)
{
+ bool keys_file_exists;
+ bool wallet_file_exists;
+ tools::wallet2::wallet_exists(path, keys_file_exists, wallet_file_exists);
+ if(keys_file_exists){
+ return true;
+ }
return false;
}
@@ -91,7 +97,7 @@ std::vector<std::string> WalletManagerImpl::findWallets(const std::string &path)
boost::filesystem::path work_dir(path);
// return empty result if path doesn't exist
if(!boost::filesystem::is_directory(path)){
- return result;
+ return result;
}
const boost::regex wallet_rx("(.*)\\.(keys)$"); // searching for <wallet_name>.keys files
boost::filesystem::recursive_directory_iterator end_itr; // Default ctor yields past-the-end