Skip to content

Commit 529b866

Browse files
committed
Test datadir in conf file exists
1 parent 91eeaa0 commit 529b866

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/util.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,9 @@ void ArgsManager::ReadConfigFile(const std::string& confPath)
639639
}
640640
// If datadir is changed in .conf file:
641641
ClearDatadirCache();
642+
if (!fs::is_directory(GetDataDir(false))) {
643+
throw std::runtime_error(strprintf("specified data directory \"%s\" does not exist.", gArgs.GetArg("-datadir", "").c_str()));
644+
}
642645
}
643646

644647
#ifndef WIN32

0 commit comments

Comments
 (0)