@@ -592,29 +592,30 @@ int GuiMain(int argc, char* argv[])
592
592
// Gracefully exit if the user cancels
593
593
if (!Intro::showIfNeeded (did_show_intro, prune_MiB)) return EXIT_SUCCESS;
594
594
595
- // / 6. Determine availability of data directory and parse bitcoin.conf
596
- // / - Do not call gArgs.GetDataDirNet() before this step finishes
595
+ // / 6a. Determine availability of data directory
597
596
if (!CheckDataDirOption ()) {
598
597
InitError (strprintf (Untranslated (" Specified data directory \" %s\" does not exist.\n " ), gArgs .GetArg (" -datadir" , " " )));
599
598
QMessageBox::critical (nullptr , PACKAGE_NAME,
600
599
QObject::tr (" Error: Specified data directory \" %1\" does not exist." ).arg (QString::fromStdString (gArgs .GetArg (" -datadir" , " " ))));
601
600
return EXIT_FAILURE;
602
601
}
603
- if (!gArgs .ReadConfigFiles (error, true )) {
604
- InitError (strprintf (Untranslated (" Error reading configuration file: %s\n " ), error));
605
- QMessageBox::critical (nullptr , PACKAGE_NAME,
606
- QObject::tr (" Error: Cannot parse configuration file: %1." ).arg (QString::fromStdString (error)));
607
- return EXIT_FAILURE;
608
- }
602
+ try {
603
+ // / 6b. Parse bitcoin.conf
604
+ // / - Do not call gArgs.GetDataDirNet() before this step finishes
605
+ if (!gArgs .ReadConfigFiles (error, true )) {
606
+ InitError (strprintf (Untranslated (" Error reading configuration file: %s\n " ), error));
607
+ QMessageBox::critical (nullptr , PACKAGE_NAME,
608
+ QObject::tr (" Error: Cannot parse configuration file: %1." ).arg (QString::fromStdString (error)));
609
+ return EXIT_FAILURE;
610
+ }
609
611
610
- // / 7. Determine network (and switch to network specific options)
611
- // - Do not call Params() before this step
612
- // - Do this after parsing the configuration file, as the network can be switched there
613
- // - QSettings() will use the new application name after this, resulting in network-specific settings
614
- // - Needs to be done before createOptionsModel
612
+ // / 7. Determine network (and switch to network specific options)
613
+ // - Do not call Params() before this step
614
+ // - Do this after parsing the configuration file, as the network can be switched there
615
+ // - QSettings() will use the new application name after this, resulting in network-specific settings
616
+ // - Needs to be done before createOptionsModel
615
617
616
- // Check for chain settings (Params() calls are only valid after this clause)
617
- try {
618
+ // Check for chain settings (Params() calls are only valid after this clause)
618
619
SelectParams (gArgs .GetChainName ());
619
620
} catch (std::exception &e) {
620
621
InitError (Untranslated (strprintf (" %s\n " , e.what ())));
0 commit comments