plugin: nwc: add update timer to connection list
What changed, and why it matters
This commit adds a simple UI refresh timer to the NWC (Nostr Wallet Connect) plugin's connection list window. Every 5 seconds, the list of wallet connections is refreshed so that users can see updated budget information without manually closing and reopening the window. There is no security-relevant change visible in the diff.
No security action required. This is a normal UI enhancement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change imports QTimer from PyQt6.QtCore and creates a QTimer owned by the dialog. The timer fires every 5,000 ms and calls update_connections_list(), which refreshes the displayed connection list. This is a straightforward UI/usability improvement with no input handling, network, cryptographic, or privilege changes.
Changed components
electrum/plugins/nwc/qt.pyInspect captured patch +6 / −1
diff --git a/electrum/plugins/nwc/qt.py b/electrum/plugins/nwc/qt.py
index 1d2dcef..8dc412b 100644
--- a/electrum/plugins/nwc/qt.py
+++ b/electrum/plugins/nwc/qt.py
@@ -32,7 +32,7 @@ from PyQt6.QtWidgets import (
QTextEdit, QApplication, QSpinBox, QSizePolicy, QComboBox, QLineEdit,
)
from PyQt6.QtGui import QPixmap, QImage
-from PyQt6.QtCore import Qt
+from PyQt6.QtCore import Qt, QTimer
from electrum.i18n import _
from electrum.plugin import hook
@@ -197,6 +197,11 @@ class Plugin(NWCServerPlugin):
vbox.addLayout(footer_buttons)
d.setLayout(main_layout)
+ # update the list from time to time to see if budgets have changed
+ refresh_timer = QTimer(d)
+ refresh_timer.timeout.connect(update_connections_list)
+ refresh_timer.start(5_000) # msec
+
return bool(d.exec())
def connection_info_input_dialog(self, window) -> Optional[str]:
Why this scored 15/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.