From 364f503a6b66535ce6bbea2d666465f44bf42a06 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Thu, 27 May 2021 00:24:35 +0200 Subject: [PATCH] Ensure onInitialNetworkConfigured is called --- src/WindowManager.cpp | 9 +++++++-- src/WindowManager.h | 1 + src/mainwindow.cpp | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/WindowManager.cpp b/src/WindowManager.cpp index 107f188..f77b098 100644 --- a/src/WindowManager.cpp +++ b/src/WindowManager.cpp @@ -119,6 +119,8 @@ void WindowManager::onWalletOpened(Wallet *wallet) { return; } + this->onInitialNetworkConfigured(); + // Create new mainwindow with wallet m_splashDialog->hide(); @@ -328,8 +330,11 @@ void WindowManager::buildTrayMenu() { // ######################## NETWORKING ######################## void WindowManager::onInitialNetworkConfigured() { - this->initTor(); - this->initWS(); + if (!m_initialNetworkConfigured) { + m_initialNetworkConfigured = true; + this->initTor(); + this->initWS(); + } } void WindowManager::initTor() { diff --git a/src/WindowManager.h b/src/WindowManager.h index 3d99c6d..809d5c6 100644 --- a/src/WindowManager.h +++ b/src/WindowManager.h @@ -73,6 +73,7 @@ private: bool m_openWalletTriedOnce = false; bool m_openingWallet = false; + bool m_initialNetworkConfigured = false; }; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 316b4cc..3d2e3ac 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -89,7 +89,7 @@ MainWindow::MainWindow(WindowManager *windowManager, Wallet *wallet, QWidget *pa }); config()->set(Config::firstRun, false); - + this->onWalletOpened(); #ifdef DONATE_BEG