From 5cac176dfbc758508122dcb4562c6e6917cbd969 Mon Sep 17 00:00:00 2001 From: donkey-ai Date: Thu, 16 Jul 2026 09:37:40 +0000 Subject: [PATCH] v0.5.16: onion helpers + download filter --- bal/gui/qt/common.py | 1 + bal/gui/qt/window.py | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/bal/gui/qt/common.py b/bal/gui/qt/common.py index 7bb43c2..87ee993 100644 --- a/bal/gui/qt/common.py +++ b/bal/gui/qt/common.py @@ -72,6 +72,7 @@ from ...core.will import (AmountException, HeirChangeException, WillexecutorChangeException, WillExecutorNotPresent, WillExpiredException, WillItem, WillPostponedException) from ...core.willexecutors import Willexecutors +from ...core.willexecutors import is_onion_url, is_tor_active # noqa: F401 # --- Presentation helpers --- from .theme import server_status_text, server_status_tooltip, status_color diff --git a/bal/gui/qt/window.py b/bal/gui/qt/window.py index 4408376..fbfa81c 100644 --- a/bal/gui/qt/window.py +++ b/bal/gui/qt/window.py @@ -1157,12 +1157,20 @@ class BalWindow: ) if resp: result = resp - for w in result: - if w not in ("status", "url"): - Willexecutors.initialize_willexecutor( - result[w], w, None, - old_willexecutors.get(w, None), - ) + # Tor gating: if Electrum is NOT connected through Tor, drop + # the .onion servers entirely - they are unreachable without + # Tor and would only waste time. When on Tor, keep them all. + tor_on = is_tor_active() + for w in list(result.keys()): + if w in ("status", "url"): + continue + if not tor_on and is_onion_url(w): + del result[w] + continue + Willexecutors.initialize_willexecutor( + result[w], w, None, + old_willexecutors.get(w, None), + ) break _logger.warning(f"fetch_will_executors_list: {url} -> empty response") except Exception as e: