connect(m_updateNetworkInfoAction, &QAction::triggered, this, [this]() {
if (!m_wallet) return;
- this->setStatusText(tr("Fetching network info..."));
+ this->setStatusText(tr("Scanning (Fetching network info)..."));
m_wallet->updateNetworkStatus();
});
void Nodes::onWalletRefreshed() {
if (conf()->get(Config::proxy) == Config::Proxy::Tor && conf()->get(Config::torPrivacyLevel).toInt() == Config::allTorExceptInitSync) {
+ // Privacy switch already triggered this session, don't repeat
+ if (m_privacySwitchDone)
+ return;
+
// Don't reconnect if we're connected to a local node (traffic will not be routed through Tor)
if (m_connection.isLocal())
return;
if (m_connection.isOnion())
return;
- // If want onion node but aren't connected to one, reconnect used to blindly fire.
- // We should check if we actually intend to switch.
+ // If want onion node but aren't connected to one, trigger the switch
if (this->useOnionNodes()) {
+ qInfo() << "Privacy switch: switching from clearnet to onion after initial sync";
+ m_privacySwitchDone = true;
this->autoConnect(true);
}
}
bool m_enableAutoconnect = true;
bool m_allowConnection = false;
+ bool m_privacySwitchDone = false; // Tracks if allTorExceptInitSync switch has fired
FeatherNode pickEligibleNode();