m_actionEnableWebsocket = new QAction(tr("Enable Websocket"), this);
m_actionEnableWebsocket->setCheckable(true);
m_actionEnableWebsocket->setChecked(!conf()->get(Config::disableWebsocket).toBool());
- m_statusLabelStatus->addAction(m_actionEnableWebsocket);
connect(m_actionEnableWebsocket, &QAction::toggled, this, [](bool checked){
conf()->set(Config::disableWebsocket, !checked);
QAction *scanTxAction = new QAction(tr("Import Transaction"), this);
m_statusLabelStatus->addAction(scanTxAction);
- m_updateNetworkInfoAction = new QAction(tr("Update Network Info"), this);
+ m_updateNetworkInfoAction = new QAction(tr("Scan Now"), this);
m_updateNetworkInfoAction->setEnabled(!pauseSyncAction->isChecked());
m_statusLabelStatus->addAction(m_updateNetworkInfoAction);
connect(m_updateNetworkInfoAction, &QAction::triggered, this, [this]() {
if (!m_wallet) return;
- this->setStatusText(tr("Scanning (Fetching network info)..."));
+ qDebug() << "Scanning wallet...";
+ this->setStatusText(tr("Scanning..."));
+ QApplication::processEvents(); // Ensure status text is visible immediately
m_wallet->updateNetworkStatus();
});
}
if (status == Wallet::ConnectionStatus_Disconnected || forceReconnect) {
+ // If we had a working connection and it dropped (transient disconnect),
+ // try reconnecting to the same node instead of picking a new one
+ if (m_connection.isValid() && m_connection.isActive && !forceReconnect) {
+ qDebug() << "Transient disconnect, reconnecting to same node:" << m_connection.toAddress();
+ this->connectToNode(m_connection);
+ return;
+ }
+
+ // Otherwise, mark the failed node and pick a new one
if (m_connection.isValid() && !forceReconnect) {
m_recentFailures << m_connection.toAddress();
}