mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
gui: Delay interfaces::Node initialization
This is needed to allow bitcoin-gui to connect to existing node process with -ipcconnect instead of spawning a new process. It's possible to spawn a new bitcoin-node process without knowing the current data dir or network, but connecting to an existing bitcoin-node requires knowing the datadir and network first.
This commit is contained in:
@@ -249,7 +249,6 @@ void BitcoinApplication::createPaymentServer()
|
||||
void BitcoinApplication::createOptionsModel(bool resetSettings)
|
||||
{
|
||||
optionsModel = new OptionsModel(this, resetSettings);
|
||||
optionsModel->setNode(node());
|
||||
}
|
||||
|
||||
void BitcoinApplication::createWindow(const NetworkStyle *networkStyle)
|
||||
@@ -264,7 +263,6 @@ void BitcoinApplication::createSplashScreen(const NetworkStyle *networkStyle)
|
||||
{
|
||||
assert(!m_splash);
|
||||
m_splash = new SplashScreen(nullptr, 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.
|
||||
m_splash->show();
|
||||
@@ -276,6 +274,8 @@ 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()
|
||||
@@ -465,7 +465,6 @@ int GuiMain(int argc, char* argv[])
|
||||
#endif
|
||||
|
||||
BitcoinApplication app;
|
||||
app.setNode(*node);
|
||||
|
||||
/// 2. Parse command-line options. We do this after qt in order to show an error if there are problems parsing these
|
||||
// Command-line options take precedence:
|
||||
@@ -599,6 +598,8 @@ int GuiMain(int argc, char* argv[])
|
||||
if (gArgs.GetBoolArg("-splash", DEFAULT_SPLASHSCREEN) && !gArgs.GetBoolArg("-min", false))
|
||||
app.createSplashScreen(networkStyle.data());
|
||||
|
||||
app.setNode(*node);
|
||||
|
||||
int rv = EXIT_SUCCESS;
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user