Skip to content

Commit 5ce8033

Browse files
committed
Qt: do not expose watchtower in settings
running a watchtower requires to be able to run a daemon with the watchtower plugin enabled. If users succeed at doing that, we can expect them to be able to configure theclient using the command line. (that would not work with QML, though. maybe QML could use an advanced config editor)
1 parent 8a96c88 commit 5ce8033

File tree

3 files changed

+8
-28
lines changed

3 files changed

+8
-28
lines changed

electrum/gui/qt/settings_dialog.py

-17
Original file line numberDiff line numberDiff line change
@@ -144,22 +144,6 @@ def on_legacy_add_trampoline_checked(_x):
144144
self.config.LIGHTNING_LEGACY_ADD_TRAMPOLINE = legacy_add_trampoline_cb.isChecked()
145145
legacy_add_trampoline_cb.stateChanged.connect(on_legacy_add_trampoline_checked)
146146

147-
remote_wt_cb = checkbox_from_configvar(self.config.cv.WATCHTOWER_CLIENT_ENABLED)
148-
remote_wt_cb.setChecked(self.config.WATCHTOWER_CLIENT_ENABLED)
149-
150-
def on_remote_wt_checked(_x):
151-
self.config.WATCHTOWER_CLIENT_ENABLED = remote_wt_cb.isChecked()
152-
self.watchtower_url_e.setEnabled(remote_wt_cb.isChecked())
153-
remote_wt_cb.stateChanged.connect(on_remote_wt_checked)
154-
watchtower_url = self.config.WATCHTOWER_CLIENT_URL
155-
self.watchtower_url_e = QLineEdit(watchtower_url)
156-
self.watchtower_url_e.setEnabled(self.config.WATCHTOWER_CLIENT_ENABLED)
157-
158-
def on_wt_url():
159-
url = self.watchtower_url_e.text() or None
160-
self.config.WATCHTOWER_CLIENT_URL = url
161-
self.watchtower_url_e.editingFinished.connect(on_wt_url)
162-
163147
lnfee_hlabel = HelpLabel.from_configvar(self.config.cv.LIGHTNING_PAYMENT_FEE_MAX_MILLIONTHS)
164148
lnfee_map = [500, 1_000, 3_000, 5_000, 10_000, 20_000, 30_000, 50_000]
165149

@@ -411,7 +395,6 @@ def on_history_rates(_x):
411395
lightning_widgets = []
412396
lightning_widgets.append((trampoline_cb, None))
413397
lightning_widgets.append((legacy_add_trampoline_cb, None))
414-
lightning_widgets.append((remote_wt_cb, self.watchtower_url_e))
415398
lightning_widgets.append((lnfee_hlabel, lnfee_hbox_w))
416399
fiat_widgets = []
417400
fiat_widgets.append((QLabel(_('Fiat currency')), ccy_combo))

electrum/plugins/watchtower/__init__.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@
22

33
fullname = _('Watchtower')
44
description = """
5-
Watchtower for Electrum.
5+
A watchtower is a daemon that watches your channels and prevents the other party from stealing funds by broadcasting an old state.
66
7-
Example setup:
7+
Example:
8+
9+
daemon setup:
810
911
electrum -o setconfig enable_plugin_watchtower True
1012
electrum -o setconfig watchtower_user wtuser
1113
electrum -o setconfig watchtower_password wtpassword
1214
electrum -o setconfig watchtower_port 12345
1315
electrum daemon -v
1416
17+
client setup:
18+
19+
electrum -o setconfig watchtower_url http://wtuser:[email protected]:12345
20+
1521
"""
1622

1723
available_for = ['cmdline']

electrum/simple_config.py

-9
Original file line numberDiff line numberDiff line change
@@ -1212,15 +1212,6 @@ def __setattr__(self, name, value):
12121212
ZEROCONF_MIN_OPENING_FEE = ConfigVar('zeroconf_min_opening_fee', default=5000, type_=int)
12131213

12141214
# connect to remote WT
1215-
WATCHTOWER_CLIENT_ENABLED = ConfigVar(
1216-
'use_watchtower', default=False, type_=bool,
1217-
short_desc=lambda: _("Use a remote watchtower"),
1218-
long_desc=lambda: ' '.join([
1219-
_("A watchtower is a daemon that watches your channels and prevents the other party from stealing funds by broadcasting an old state."),
1220-
_("If you have private a watchtower, enter its URL here."),
1221-
_("Check our online documentation if you want to configure Electrum as a watchtower."),
1222-
]),
1223-
)
12241215
WATCHTOWER_CLIENT_URL = ConfigVar('watchtower_url', default=None, type_=str)
12251216

12261217
# run WT locally

0 commit comments

Comments
 (0)