Fix datadir handling in bitcoind

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.
This commit is contained in:
Hennadii Stepanov
2019-07-24 03:29:40 +03:00
parent 740d41ce9f
commit 50824093bb
2 changed files with 2 additions and 3 deletions

View File

@@ -92,8 +92,7 @@ static bool AppInit(int argc, char* argv[])
try
{
if (!fs::is_directory(GetDataDir(false)))
{
if (!CheckDataDirOption()) {
return InitError(strprintf("Specified data directory \"%s\" does not exist.\n", gArgs.GetArg("-datadir", "")));
}
if (!gArgs.ReadConfigFiles(error, true)) {