Skip to content

Implement #22219 changes in the qml/bitcoin.cpp #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/qml/bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <qml/bitcoin.h>

#include <init.h>
#include <interfaces/init.h>
#include <interfaces/node.h>
#include <logging.h>
#include <node/context.h>
Expand Down Expand Up @@ -91,9 +92,6 @@ int QmlGuiMain(int argc, char* argv[])
std::tie(argc, argv) = winArgs.get();
#endif // WIN32

SetupEnvironment();
util::ThreadSetInternalName("main");

Q_INIT_RESOURCE(bitcoin_qml);

QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
Expand All @@ -102,6 +100,11 @@ int QmlGuiMain(int argc, char* argv[])
auto handler_message_box = ::uiInterface.ThreadSafeMessageBox_connect(InitErrorMessageBox);

NodeContext node_context;
int unused_exit_status;
std::unique_ptr<interfaces::Init> init = interfaces::MakeNodeInit(node_context, argc, argv, unused_exit_status);

SetupEnvironment();
util::ThreadSetInternalName("main");

/// Parse command-line options. We do this after qt in order to show an error if there are problems parsing these.
node_context.args = &gArgs;
Expand Down Expand Up @@ -147,7 +150,7 @@ int QmlGuiMain(int argc, char* argv[])

GUIUtil::LogQtInfo();

std::unique_ptr<interfaces::Node> node = interfaces::MakeNode(&node_context);
std::unique_ptr<interfaces::Node> node = init->makeNode();
if (!node->baseInitialize()) {
// A dialog with detailed error will have been shown by InitError().
return EXIT_FAILURE;
Expand Down