diff --git a/electrum/gui/qt/__init__.py b/electrum/gui/qt/__init__.py index 00eb5d34e..61c80c9fb 100644 --- a/electrum/gui/qt/__init__.py +++ b/electrum/gui/qt/__init__.py @@ -370,8 +370,6 @@ class ElectrumGui(Logger): with self._num_wizards_lock: if self._num_wizards_in_progress > 0 or len(self.windows) > 0: return - if self.config.get('persist_daemon'): - return self.app.quit() self.app.setQuitOnLastWindowClosed(False) # so _we_ can decide whether to quit self.app.lastWindowClosed.connect(quit_after_last_window) diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py index 7ab02a617..2ba1875da 100644 --- a/electrum/gui/qt/main_window.py +++ b/electrum/gui/qt/main_window.py @@ -746,7 +746,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): tools_menu.addAction(_("Electrum preferences"), self.settings_dialog) tools_menu.addAction(_("&Network"), self.gui_object.show_network_dialog).setEnabled(bool(self.network)) - tools_menu.addAction(_("Local &Watchtower"), self.gui_object.show_watchtower_dialog).setEnabled(bool(self.network and self.network.local_watchtower)) + if self.network and self.network.local_watchtower: + tools_menu.addAction(_("Local &Watchtower"), self.gui_object.show_watchtower_dialog) tools_menu.addAction(_("&Plugins"), self.plugins_dialog) tools_menu.addSeparator() tools_menu.addAction(_("&Sign/verify message"), self.sign_verify_message) diff --git a/electrum/gui/qt/settings_dialog.py b/electrum/gui/qt/settings_dialog.py index 647d00b0d..4d52943f1 100644 --- a/electrum/gui/qt/settings_dialog.py +++ b/electrum/gui/qt/settings_dialog.py @@ -161,31 +161,13 @@ channels graph and compute payment path locally, instead of using trampoline pay gossip_cb.stateChanged.connect(on_gossip_checked) lightning_widgets.append((gossip_cb, None)) - help_local_wt = _("""If this option is checked, Electrum will -run a local watchtower and protect your channels even if your wallet is not -open. For this to work, your computer needs to be online regularly.""") - local_wt_cb = QCheckBox(_("Run a local watchtower")) - local_wt_cb.setToolTip(help_local_wt) - local_wt_cb.setChecked(bool(self.config.get('run_local_watchtower', False))) - def on_local_wt_checked(x): - self.config.set_key('run_local_watchtower', bool(x)) - local_wt_cb.stateChanged.connect(on_local_wt_checked) - lightning_widgets.append((local_wt_cb, None)) - - help_persist = _("""If this option is checked, Electrum will persist after -you close all your wallet windows, and the Electrum icon will be visible in the taskbar. -Use this if you want your local watchtower to keep running after you close your wallet.""") - persist_cb = QCheckBox(_("Persist after all windows are closed")) - persist_cb.setToolTip(help_persist) - persist_cb.setChecked(bool(self.config.get('persist_daemon', False))) - def on_persist_checked(x): - self.config.set_key('persist_daemon', bool(x)) - persist_cb.stateChanged.connect(on_persist_checked) - lightning_widgets.append((persist_cb, None)) - - help_remote_wt = _("""To use a remote watchtower, enter the corresponding URL here""") + help_remote_wt = ' '.join([ + _("A watchtower is a daemon that watches your channels and prevents the other party from stealing funds by broadcasting an old state."), + _("If you have private a watchtower, enter its URL here."), + _("Check our online documentation if you want to configure Electrum as a watchtower."), + ]) remote_wt_cb = QCheckBox(_("Use a remote watchtower")) - remote_wt_cb.setToolTip(help_remote_wt) + remote_wt_cb.setToolTip('
'+help_remote_wt+'
') remote_wt_cb.setChecked(bool(self.config.get('use_watchtower', False))) def on_remote_wt_checked(x): self.config.set_key('use_watchtower', bool(x)) diff --git a/electrum/network.py b/electrum/network.py index a72f4d013..268a02700 100644 --- a/electrum/network.py +++ b/electrum/network.py @@ -351,7 +351,7 @@ class Network(Logger, NetworkRetryManager[ServerAddr]): # lightning network self.channel_blacklist = ChannelBlackList() - if self.config.get('run_local_watchtower', False): + if self.config.get('run_watchtower', False): from . import lnwatcher self.local_watchtower = lnwatcher.WatchTower(self) self.local_watchtower.start_network(self) diff --git a/electrum/tests/regtest/regtest.sh b/electrum/tests/regtest/regtest.sh index 471948eaf..c16cb2c38 100755 --- a/electrum/tests/regtest/regtest.sh +++ b/electrum/tests/regtest/regtest.sh @@ -316,7 +316,7 @@ fi if [[ $1 == "configure_test_watchtower" ]]; then # carol is the watchtower of bob - $carol setconfig -o run_local_watchtower true + $carol setconfig -o run_watchtower true $carol setconfig -o watchtower_user wtuser $carol setconfig -o watchtower_password wtpassword $carol setconfig -o watchtower_address 127.0.0.1:12345