aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoin.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2019-07-24 18:54:32 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2019-07-24 18:54:32 +0300
commitb28dada37465c0a773cf08b0e6766f0081bcb943 (patch)
tree8f8ea9983da5435237963d9b0d30e4c73fd18b74 /src/qt/bitcoin.cpp
parent50824093bb2d68fe1393dfd636fab5f8795faa5d (diff)
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.
Diffstat (limited to 'src/qt/bitcoin.cpp')
-rw-r--r--src/qt/bitcoin.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index ed5d47cad7..545dcef14a 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -495,10 +495,9 @@ int GuiMain(int argc, char* argv[])
if (!Intro::pickDataDirectory(*node))
return EXIT_SUCCESS;
- /// 6. Determine availability of data and blocks directory and parse bitcoin.conf
+ /// 6. Determine availability of data directory and parse bitcoin.conf
/// - Do not call GetDataDir(true) before this step finishes
- if (!fs::is_directory(GetDataDir(false)))
- {
+ if (!CheckDataDirOption()) {
node->initError(strprintf("Specified data directory \"%s\" does not exist.\n", gArgs.GetArg("-datadir", "")));
QMessageBox::critical(nullptr, PACKAGE_NAME,
QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(gArgs.GetArg("-datadir", ""))));