@@ -592,29 +592,30 @@ int GuiMain(int argc, char* argv[])
592592 // Gracefully exit if the user cancels
593593 if (!Intro::showIfNeeded (did_show_intro, prune_MiB)) return EXIT_SUCCESS;
594594
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
597596 if (!CheckDataDirOption ()) {
598597 InitError (strprintf (Untranslated (" Specified data directory \" %s\" does not exist.\n " ), gArgs .GetArg (" -datadir" , " " )));
599598 QMessageBox::critical (nullptr , PACKAGE_NAME,
600599 QObject::tr (" Error: Specified data directory \" %1\" does not exist." ).arg (QString::fromStdString (gArgs .GetArg (" -datadir" , " " ))));
601600 return EXIT_FAILURE;
602601 }
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+ }
609611
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
615617
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)
618619 SelectParams (gArgs .GetChainName ());
619620 } catch (std::exception &e) {
620621 InitError (Untranslated (strprintf (" %s\n " , e.what ())));
0 commit comments