aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-cli.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2019-07-24 18:54:46 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2019-07-24 18:54:46 +0300
commit7e33a18a34b1a9b0f115076c142661d6d30c0585 (patch)
treef5488a7fd7f125142b17a72ca4b0d5edba914fd0 /src/bitcoin-cli.cpp
parentb28dada37465c0a773cf08b0e6766f0081bcb943 (diff)
downloadbitcoin-7e33a18a34b1a9b0f115076c142661d6d30c0585.tar.xz
Fix datadir handling in bitcoin-cli
This prevents premature tries to access or create the default datadir. This is useful when the -datadir option is specified and the default datadir is unreachable.
Diffstat (limited to 'src/bitcoin-cli.cpp')
-rw-r--r--src/bitcoin-cli.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp
index d3419520a7..b5c9747f47 100644
--- a/src/bitcoin-cli.cpp
+++ b/src/bitcoin-cli.cpp
@@ -123,7 +123,7 @@ static int AppInitRPC(int argc, char* argv[])
}
return EXIT_SUCCESS;
}
- if (!fs::is_directory(GetDataDir(false))) {
+ if (!CheckDataDirOption()) {
tfm::format(std::cerr, "Error: Specified data directory \"%s\" does not exist.\n", gArgs.GetArg("-datadir", "").c_str());
return EXIT_FAILURE;
}