1
0

Fix get_pending_swaps: use both funding and spending tx heights

Also, do not show closing warnings if we are offline.
This commit is contained in:
ThomasV
2025-05-08 14:56:52 +02:00
parent 2b68f65aac
commit db271d9b7d
2 changed files with 8 additions and 6 deletions

View File

@@ -2699,7 +2699,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener):
warning = ''.join([
_("Are you sure you want to close Electrum?"),
'\n\n',
_("An ongoing operation prevents Electrum from closing:"),
_("An ongoing operation requires you to stay online."),
'\n',
warning
])
@@ -2734,6 +2734,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener):
"""Callback that will return a warning string if there are unconfirmed swap funding txs."""
if not (self.wallet.has_lightning() and self.wallet.lnworker.swap_manager):
return None
if not self.network:
return None
if ongoing_swaps := self.wallet.lnworker.swap_manager.get_pending_swaps():
return "".join((
f"{str(len(ongoing_swaps))} ",