fix(settings): disable the unimplemented Tor option and tell its users

The "Use Tor" checkbox was saved but never read: no build routed any
traffic (node, RPC, price/update/bootstrap/pool HTTP or Lite gRPC)
through Tor, so users who ticked it believed they were anonymous.

- The checkbox is disabled and always shown unticked, on the Settings
  page and in the legacy Settings window. Its tooltip says it is not
  available and gives the alternatives: for the node, proxy=127.0.0.1:9050
  in DRAGONX.conf with Tor running; otherwise a system-wide VPN/Tor (Lite
  builds get the short version). The "Use Tor" label is kept.
- Behaviour change: a stored use_tor=true is cleared once at startup
  (Settings::consumeLegacyUseTor + a synchronous save before the async
  writer and any Settings page state), with a 20 s warning in the user's
  language. The cleared key is the "already told" flag, so the notice
  never repeats. No settings format change.
- 3 new strings (tt_tor_unavailable, tt_tor_unavailable_lite,
  tor_never_applied_notice) in all 8 languages; the tooltip wraps at
  tor-tooltip-wrap-width from ui.toml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-12 13:22:00 -05:00
co-authored by Claude Opus 5.5
parent ae66b54694
commit a581f42a33
15 changed files with 115 additions and 4 deletions
+10
View File
@@ -412,6 +412,14 @@ bool App::init()
settings_->save(); // no writer attached yet: synchronous
settings_->clearUpgradeSave();
}
// "Use Tor" never did anything. Clear a stored opt-in once, synchronously and before any Settings
// page state is loaded (so nothing writes it back), and warn that user below, once the saved
// language is loaded.
const bool legacyTorCleared = settings_->consumeLegacyUseTor();
if (legacyTorCleared) {
DEBUG_LOGF("[INFO] Cleared the unimplemented use_tor setting\n");
settings_->save(); // no writer attached yet: synchronous
}
// From here on settings_->save() is written by file_writer_ off the UI thread (flushed by main()
// at exit); a save after a fund/security-critical setter still waits for the disk (Settings::save).
settings_->setFileWriter(&file_writer_);
@@ -501,6 +509,8 @@ bool App::init()
if (!lang.empty()) {
util::I18n::instance().loadLanguage(lang);
}
if (legacyTorCleared)
ui::Notifications::instance().warning(TR("tor_never_applied_notice"), 20.0f);
// Initialize RPC client
rpc_ = std::make_unique<rpc::RPCClient>();
+4
View File
@@ -201,6 +201,10 @@ public:
bool getUseTor() const { return use_tor_; }
void setUseTor(bool tor) { use_tor_ = tor; }
// "Use Tor" was never implemented: no build routed any traffic through Tor. Clears a stored opt-in
// and reports whether there was one, so App::init can tell that user once (the cleared key is the
// "already told" flag).
bool consumeLegacyUseTor() { const bool was = use_tor_; use_tor_ = false; return was; }
// Fees
bool getAllowCustomFees() const { return allow_custom_fees_; }
+16 -2
View File
@@ -1250,8 +1250,22 @@ void RenderSettingsPage(App* app) {
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("tt_save_ztx"));
CB(TrId("auto_shield", "auto_shld"), &s_settingsState.auto_shield);
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("tt_auto_shield"));
CB(TrId("use_tor", "tor"), &s_settingsState.use_tor);
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("tt_tor"));
{
// Not implemented: disabled and never shown as "on", even for a stored use_tor=true.
bool torOff = false;
ImGui::BeginDisabled();
CB(TrId("use_tor", "tor"), &torOff);
ImGui::EndDisabled();
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) {
const float wrapW = S.drawElement("components.settings-page", "tor-tooltip-wrap-width")
.sizeOr(420.0f) * Layout::dpiScale();
material::BeginTooltip();
ImGui::PushTextWrapPos(wrapW);
ImGui::TextUnformatted(TR(app->isLiteBuild() ? "tt_tor_unavailable_lite" : "tt_tor_unavailable"));
ImGui::PopTextWrapPos();
material::EndTooltip();
}
}
if (showDaemonOptions) {
if (CB(TrId("keep_daemon", "keep_dmn"), &s_settingsState.keep_daemon_running))
saveSettingsPageState(app->settings());
+17 -2
View File
@@ -369,8 +369,23 @@ void RenderSettingsWindow(App* app, bool* p_open)
ImGui::Spacing();
ImGui::Checkbox(TrId("settings_use_tor_network", "tor_w").c_str(), &s_use_tor);
ImGui::TextDisabled(" %s", TR("settings_tor_desc"));
{
// Not implemented: disabled and never shown as "on", even for a stored use_tor=true.
bool torOff = false;
ImGui::BeginDisabled();
ImGui::Checkbox(TrId("settings_use_tor_network", "tor_w").c_str(), &torOff);
ImGui::EndDisabled();
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) {
const float wrapW = S.drawElement("components.settings-page", "tor-tooltip-wrap-width")
.sizeOr(420.0f) * Layout::dpiScale();
material::BeginTooltip();
ImGui::PushTextWrapPos(wrapW);
ImGui::TextUnformatted(TR(app && app->isLiteBuild() ? "tt_tor_unavailable_lite"
: "tt_tor_unavailable"));
ImGui::PopTextWrapPos();
material::EndTooltip();
}
}
ImGui::Spacing();
ImGui::Separator();
+3
View File
@@ -806,6 +806,9 @@ void I18n::loadBuiltinEnglish()
strings_["tt_save_ztx"] = "Store z-address transaction history locally for faster loading";
strings_["tt_auto_shield"] = "Automatically move transparent balance to shielded addresses for privacy";
strings_["tt_tor"] = "Route daemon connections through the Tor network for anonymity";
strings_["tt_tor_unavailable"] = "Not available yet: this wallet does not route any traffic through Tor. For the node only, you can add proxy=127.0.0.1:9050 to DRAGONX.conf and restart the node. Tor must be running, or the node finds no peers. Price, update, bootstrap and pool requests still connect directly; use a system-wide VPN/Tor for those.";
strings_["tt_tor_unavailable_lite"] = "Not available yet: this wallet does not route any traffic through Tor. Use a system-wide VPN/Tor.";
strings_["tor_never_applied_notice"] = "The \"Use Tor\" option was never functional: your connections were NOT routed through Tor. It has been switched off. See its tooltip in Settings for alternatives.";
strings_["tt_keep_daemon"] = "Daemon will still stop when running the setup wizard";
strings_["tt_stop_external"] = "Applies when connecting to a daemon\nyou started outside this wallet";
strings_["stratum_host_section"] = "MINING POOL HOSTING";