qml: qeaddresslistmodel mark self dirty on {new,removed}_transaction events
What changed, and why it matters
This commit is a small UI cleanup in Electrum's QML (mobile/desktop modern interface) code. It moves responsibility for refreshing the address list when transactions arrive or are removed from one file to another, so the address list model refreshes itself instead of relying on the wallet object to tell it to refresh. There is no indication this fixes a security vulnerability; it appears to be a maintainability or correctness fix for UI consistency.
No security action required. Treat as normal UI refactor. If auditing, verify that setDirty() triggers are functionally equivalent and no refresh path is lost.
Security signals we found
No security-relevant code patterns observed
Refactoring only: moves setDirty() calls between components
No changes to transaction parsing, wallet logic, networking, or cryptography
Evidence from the diff
The patch refactors Qt event handling for transaction lifecycle events. Previously, qewallet.py’s on_event_new_transaction and on_event_removed_transaction handlers called self._addressCoinModel.setDirty() if initialized. Now, qeaddresslistmodel.py listens directly for removed_transaction and new_transaction events and marks itself dirty. This is a separation-of-concerns change: the address/coin model becomes responsible for its own invalidation. The diff shows no input validation, cryptographic, or privilege changes.
Changed components
electrum/gui/qml/qeaddresslistmodel.pyelectrum/gui/qml/qewallet.pyInspect captured patch +10 / −4
### electrum/gui/qml/qeaddresslistmodel.py
@@ -138,6 +138,16 @@ def on_event_labels_received(self, wallet, labels):
if wallet == self.wallet:
self.setDirty()
+ @qt_event_listener
+ def on_event_removed_transaction(self, wallet, tx):
+ if self.wallet == wallet:
+ self.setDirty()
+
+ @qt_event_listener
+ def on_event_new_transaction(self, wallet, tx):
+ if self.wallet == wallet:
+ self.setDirty()
+
def rowCount(self, index):
return len(self._items)
### electrum/gui/qml/qewallet.py
@@ -206,8 +206,6 @@ def on_event_new_transaction(self, wallet: 'Abstract_Wallet', tx: Transaction):
if wallet == self.wallet:
self._logger.debug(f'new transaction {tx.txid()}')
self.add_tx_notification(tx)
- if self._addressCoinModel is not None: # only setDirty if it was already initialized
- self._addressCoinModel.setDirty()
self.historyModel.setDirty() # assuming wallet.is_up_to_date triggers after
if self.wallet.is_up_to_date():
# don't update during sync as this recomputes the balance on each new tx, blocking the UI thread.
@@ -226,8 +224,6 @@ def on_event_removed_transaction(self, wallet, tx):
# is deleted along with multiple associated txs
if wallet == self.wallet:
self._logger.info(f'removed transaction {tx.txid()}')
- if self._addressCoinModel is not None:
- self._addressCoinModel.setDirty()
self.historyModel.setDirty()
self.balanceChanged.emit()
Why this scored 17/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.