connect(m_windowManager, &WindowManager::proxySettingsChanged, this, &MainWindow::onProxySettingsChangedConnect);
connect(m_windowManager, &WindowManager::updateBalance, m_wallet, &Wallet::updateBalance);
+ connect(m_windowManager, &WindowManager::websocketStatusChanged, m_wallet, &Wallet::updateBalance);
connect(m_windowManager, &WindowManager::offlineMode, this, &MainWindow::onOfflineMode);
connect(m_windowManager, &WindowManager::manualFeeSelectionEnabled, this, &MainWindow::onManualFeeSelectionEnabled);
connect(m_windowManager, &WindowManager::subtractFeeFromAmountEnabled, this, &MainWindow::onSubtractFeeFromAmountEnabled);
// Order is important, first inform UI about a potential disconnect, then reconnect
this->onConnectionStatusChanged(status);
m_nodes->autoConnect();
+ this->updateBalance();
});
connect(m_wallet, &Wallet::heightsRefreshed, this, [this](bool success, quint64 daemonHeight, quint64 targetHeight) {
bool isCacheValid = appData()->prices.lastUpdateTime.isValid();
if (balance > 0 && (balanceFiatAmount == 0.0 || !isCacheValid)) {
- if (conf()->get(Config::offlineMode).toBool() || m_wallet->connectionStatus() == Wallet::ConnectionStatus_Disconnected) {
+ if (conf()->get(Config::offlineMode).toBool() || conf()->get(Config::disableWebsocket).toBool() || m_wallet->connectionStatus() == Wallet::ConnectionStatus_Disconnected) {
suffixStr += " (offline)";
} else if (!appData()->prices.markets.contains("XMR")) {
suffixStr += " (connecting)";
success = m_walletImpl->init(daemonAddress.toStdString(), upperTransactionLimit, m_daemonUsername.toStdString(), m_daemonPassword.toStdString(), m_useSSL, false, proxyAddress.toStdString());
}
+ if (m_scheduler.stopping()) {
+ return;
+ }
+
setTrustedDaemon(trustedDaemon);
if (success) {
pauseRefresh();
m_walletImpl->stop();
+ // Stop the wallet2 instance to interrupt any blocking network calls (e.g. init)
+ if (m_wallet2)
+ m_wallet2->stop();
m_scheduler.shutdownWaitForFinished();
bool isCacheFresh = isCacheValid && appData()->prices.lastUpdateTime.secsTo(QDateTime::currentDateTime()) < 3600;
if (balanceFiatAmount == 0.0 || !isCacheValid) {
- if (conf()->get(Config::offlineMode).toBool() || m_wallet->connectionStatus() == Wallet::ConnectionStatus_Disconnected) {
+ if (conf()->get(Config::offlineMode).toBool() || conf()->get(Config::disableWebsocket).toBool() || m_wallet->connectionStatus() == Wallet::ConnectionStatus_Disconnected) {
this->setDisplayText("offline");
} else if (!appData()->prices.markets.contains("XMR")) {
this->setDisplayText("connecting");