mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 02:02:42 +02:00
Merge bitcoin/bitcoin#34767: Bugfix: GUI/Intro: Handle errors from SelectParams the same as if during InitConfig
55d37546faBugfix: GUI/Intro: Handle errors from SelectParams the same as if during InitConfig (Luke Dashjr) Pull request description: Without this, invalid vbparams just silently exit with no message ACKs for top commit: sedited: ACK55d37546fahebasto: ACK55d37546fa, tested on Fedora 44. Tree-SHA512: 0508ca64c86a651b9b21ae2a1e26dfb84c0dbb0b20d309da499545be2733d42c98012b84d81177ba0635d0d8bce87c888b256a014e2065bd4a80db88e73ec3d4
This commit is contained in:
@@ -17,7 +17,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>
|
||||
@@ -25,6 +27,7 @@
|
||||
#include <QMessageBox>
|
||||
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
|
||||
namespace {
|
||||
//! Return pruning size that will be used if automatic pruning is enabled.
|
||||
@@ -138,8 +141,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 */
|
||||
|
||||
Reference in New Issue
Block a user