diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -231,7 +231,6 @@ void BitcoinApplication::createOptionsModel(bool resetSettings) { optionsModel = new OptionsModel(nullptr, resetSettings); - optionsModel->setNode(node()); } void BitcoinApplication::createWindow(const Config *config, @@ -247,7 +246,6 @@ void BitcoinApplication::createSplashScreen(const NetworkStyle *networkStyle) { assert(!m_splash); m_splash = new SplashScreen(networkStyle); - m_splash->setNode(node()); // We don't hold a direct pointer to the splash screen after creation, but // the splash screen will take care of deleting itself when finish() // happens. @@ -261,6 +259,12 @@ void BitcoinApplication::setNode(interfaces::Node &node) { assert(!m_node); m_node = &node; + if (optionsModel) { + optionsModel->setNode(*m_node); + } + if (m_splash) { + m_splash->setNode(*m_node); + } } bool BitcoinApplication::baseInitialize(Config &config) { @@ -553,7 +557,6 @@ #endif BitcoinApplication app; - app.setNode(*node); // Register meta types used for QMetaObject::invokeMethod and // Qt::QueuedConnection @@ -759,6 +762,8 @@ app.createSplashScreen(networkStyle.data()); } + app.setNode(*node); + RPCServer rpcServer; util::Ref context{node_context}; HTTPRPCRequestProcessor httpRPCRequestProcessor(config, rpcServer, context); diff --git a/src/qt/splashscreen.h b/src/qt/splashscreen.h --- a/src/qt/splashscreen.h +++ b/src/qt/splashscreen.h @@ -63,6 +63,7 @@ int curAlignment; interfaces::Node *m_node = nullptr; + bool m_shutdown = false; std::unique_ptr m_handler_init_message; std::unique_ptr m_handler_show_progress; std::unique_ptr m_handler_load_wallet; diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -152,9 +152,13 @@ assert(!m_node); m_node = &node; subscribeToCoreSignals(); + if (m_shutdown) { + m_node->startShutdown(); + } } void SplashScreen::shutdown() { + m_shutdown = true; if (m_node) { m_node->startShutdown(); }