Bugfix: GUI/Intro: Handle errors from SelectParams the same as if during InitConfig

Without this, invalid vbparams just silently exit with no message
This commit is contained in:
Luke Dashjr
2026-03-06 23:40:27 +00:00
parent 96ec3b67a7
commit 55d37546fa

View File

@@ -18,7 +18,9 @@
#include <common/args.h>
#include <interfaces/node.h>
#include <node/interface_ui.h>
#include <util/fs_helpers.h>
#include <util/translation.h>
#include <validation.h>
#include <QFileDialog>
@@ -26,6 +28,7 @@
#include <QMessageBox>
#include <cmath>
#include <cstdlib>
/* Check free space asynchronously to prevent hanging the UI thread.
@@ -221,8 +224,10 @@ bool Intro::showIfNeeded(bool& did_show_intro, int64_t& prune_MiB)
/* Use selectParams here to guarantee Params() can be used by node interface */
try {
SelectParams(gArgs.GetChainType());
} catch (const std::exception&) {
return false;
} catch (const std::exception& e) {
InitError(Untranslated(e.what()));
QMessageBox::critical(nullptr, CLIENT_NAME, QObject::tr("Error: %1").arg(QString(e.what())));
std::exit(EXIT_FAILURE);
}
/* If current default data directory does not exist, let the user choose one */