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.
pull/764/head
Hennadii Stepanov 5 years ago
parent b28dada374
commit 7e33a18a34
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F

@ -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;
}

Loading…
Cancel
Save