From b67342906ced2353d378f4369c8d8a979d525fee Mon Sep 17 00:00:00 2001 From: MeshCollider Date: Sat, 18 Nov 2017 13:36:37 +1300 Subject: Cleanups for walletdir PR --- src/wallet/init.cpp | 5 ++++- src/wallet/walletutil.cpp | 2 +- src/wallet/walletutil.h | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp index 67c46df87..788bac2a4 100644 --- a/src/wallet/init.cpp +++ b/src/wallet/init.cpp @@ -194,7 +194,10 @@ bool VerifyWallets() } if (gArgs.IsArgSet("-walletdir") && !fs::is_directory(GetWalletDir())) { - return InitError(strprintf(_("Error: Specified wallet directory \"%s\" does not exist."), gArgs.GetArg("-walletdir", "").c_str())); + if (fs::exists(fs::system_complete(gArgs.GetArg("-walletdir", "")))) { + return InitError(strprintf(_("Specified -walletdir \"%s\" is not a directory"), gArgs.GetArg("-walletdir", "").c_str())); + } + return InitError(strprintf(_("Specified -walletdir \"%s\" does not exist"), gArgs.GetArg("-walletdir", "").c_str())); } LogPrintf("Using wallet directory %s\n", GetWalletDir().string()); diff --git a/src/wallet/walletutil.cpp b/src/wallet/walletutil.cpp index fbb5215a5..f15e5de1e 100644 --- a/src/wallet/walletutil.cpp +++ b/src/wallet/walletutil.cpp @@ -2,7 +2,7 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "wallet/walletutil.h" +#include fs::path GetWalletDir() { diff --git a/src/wallet/walletutil.h b/src/wallet/walletutil.h index a94f286a4..50ff73640 100644 --- a/src/wallet/walletutil.h +++ b/src/wallet/walletutil.h @@ -5,7 +5,8 @@ #ifndef BITCOIN_WALLET_UTIL_H #define BITCOIN_WALLET_UTIL_H -#include "util.h" +#include +#include //! Get the path of the wallet directory. fs::path GetWalletDir(); -- cgit v1.2.3