Skip to content

Commit b28dada

Browse files
committed
Fix datadir handling in bitcoin-qt
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.
1 parent 5082409 commit b28dada

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/qt/bitcoin.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,10 +495,9 @@ int GuiMain(int argc, char* argv[])
495495
if (!Intro::pickDataDirectory(*node))
496496
return EXIT_SUCCESS;
497497

498-
/// 6. Determine availability of data and blocks directory and parse bitcoin.conf
498+
/// 6. Determine availability of data directory and parse bitcoin.conf
499499
/// - Do not call GetDataDir(true) before this step finishes
500-
if (!fs::is_directory(GetDataDir(false)))
501-
{
500+
if (!CheckDataDirOption()) {
502501
node->initError(strprintf("Specified data directory \"%s\" does not exist.\n", gArgs.GetArg("-datadir", "")));
503502
QMessageBox::critical(nullptr, PACKAGE_NAME,
504503
QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(gArgs.GetArg("-datadir", ""))));

0 commit comments

Comments
 (0)