qt: Submarine Payments: update tab on_channels_updated
What changed, and why it matters
This is a small user-interface fix for the Electrum Bitcoin wallet's Qt desktop app. It makes the 'Submarine Payments' tab refresh itself once the user's Lightning channels finish loading, so an outdated liquidity warning doesn't stay on screen. There is no security vulnerability here.
No security action needed. Treat as a normal UI bug fix.
Security signals we found
No security-relevant code changes
UI-only refresh logic
No input handling, cryptography, or authorization changes
Evidence from the diff
The commit adds a Qt event listener on_event_channels_updated in electrum/gui/qt/confirm_tx_dialog.py. When the channels_updated event fires for the same wallet and the swap manager is initialized, it calls update_submarine_tab() to refresh the submarine-swap UI. This prevents stale UI state if the dialog is opened before channel initialization completes.
Changed components
electrum/gui/qt/confirm_tx_dialog.pyInspect captured patch +6 / −0
diff --git a/electrum/gui/qt/confirm_tx_dialog.py b/electrum/gui/qt/confirm_tx_dialog.py
index 2cb4f7f..9bfcc17 100644
--- a/electrum/gui/qt/confirm_tx_dialog.py
+++ b/electrum/gui/qt/confirm_tx_dialog.py
@@ -873,6 +873,12 @@ class TxEditor(WindowModalDialog, QtEventListener, Logger):
def on_event_swap_provider_changed(self):
self.update_submarine_tab()
+ @qt_event_listener
+ def on_event_channels_updated(self, wallet):
+ # useful e.g. if the user quickly opens the tab after startup before the channels are initialized
+ if wallet == self.wallet and self.swap_manager and self.swap_manager.is_initialized.is_set():
+ self.update_submarine_tab()
+
def start_submarine_swap(self):
assert self.payee_outputs and len(self.payee_outputs) == 1
payee_output = self.payee_outputs[0]
Why this scored 18/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.