|
29 | 29 |
|
30 | 30 | #include <init.h> |
31 | 31 | #include <interfaces/handler.h> |
| 32 | +#include <interfaces/init.h> |
32 | 33 | #include <interfaces/node.h> |
33 | 34 | #include <node/context.h> |
34 | 35 | #include <node/ui_interface.h> |
@@ -276,10 +277,10 @@ void BitcoinApplication::createSplashScreen(const NetworkStyle *networkStyle) |
276 | 277 | connect(this, &BitcoinApplication::requestedShutdown, m_splash, &QWidget::close); |
277 | 278 | } |
278 | 279 |
|
279 | | -void BitcoinApplication::setNode(interfaces::Node& node) |
| 280 | +void BitcoinApplication::createNode(interfaces::Init& init) |
280 | 281 | { |
281 | 282 | assert(!m_node); |
282 | | - m_node = &node; |
| 283 | + m_node = init.makeNode(); |
283 | 284 | if (optionsModel) optionsModel->setNode(*m_node); |
284 | 285 | if (m_splash) m_splash->setNode(*m_node); |
285 | 286 | } |
@@ -458,11 +459,13 @@ int GuiMain(int argc, char* argv[]) |
458 | 459 | util::WinCmdLineArgs winArgs; |
459 | 460 | std::tie(argc, argv) = winArgs.get(); |
460 | 461 | #endif |
461 | | - SetupEnvironment(); |
462 | | - util::ThreadSetInternalName("main"); |
463 | 462 |
|
464 | 463 | NodeContext node_context; |
465 | | - std::unique_ptr<interfaces::Node> node = interfaces::MakeNode(&node_context); |
| 464 | + int unused_exit_status; |
| 465 | + std::unique_ptr<interfaces::Init> init = interfaces::MakeNodeInit(node_context, argc, argv, unused_exit_status); |
| 466 | + |
| 467 | + SetupEnvironment(); |
| 468 | + util::ThreadSetInternalName("main"); |
466 | 469 |
|
467 | 470 | // Subscribe to global signals from core |
468 | 471 | boost::signals2::scoped_connection handler_message_box = ::uiInterface.ThreadSafeMessageBox_connect(noui_ThreadSafeMessageBox); |
@@ -621,7 +624,7 @@ int GuiMain(int argc, char* argv[]) |
621 | 624 | if (gArgs.GetBoolArg("-splash", DEFAULT_SPLASHSCREEN) && !gArgs.GetBoolArg("-min", false)) |
622 | 625 | app.createSplashScreen(networkStyle.data()); |
623 | 626 |
|
624 | | - app.setNode(*node); |
| 627 | + app.createNode(*init); |
625 | 628 |
|
626 | 629 | int rv = EXIT_SUCCESS; |
627 | 630 | try |
|
0 commit comments