forked from bitcoinafterlife/bal-electrum-plugin
v0.5.16: onion helpers + download filter
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1157,8 +1157,16 @@ class BalWindow:
|
||||
)
|
||||
if resp:
|
||||
result = resp
|
||||
for w in result:
|
||||
if w not in ("status", "url"):
|
||||
# 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),
|
||||
|
||||
Reference in New Issue
Block a user