diff --git a/electrum/gui/qt/history_list.py b/electrum/gui/qt/history_list.py index 4522bc092..87a89e069 100644 --- a/electrum/gui/qt/history_list.py +++ b/electrum/gui/qt/history_list.py @@ -247,8 +247,15 @@ class HistoryModel(QAbstractItemModel, PrintError): tx_item.update(fiat_fields) self.dataChanged.emit(idx, idx, [Qt.DisplayRole, Qt.ForegroundRole]) - def update_item(self, *args): - self.refresh('update_item') + def update_tx_mined_status(self, tx_hash: str, tx_mined_info: TxMinedInfo): + self.tx_status_cache[tx_hash] = self.parent.wallet.get_tx_status(tx_hash, tx_mined_info) + try: + row = self.transactions.pos_from_key(tx_hash) + except KeyError: + return + topLeft = self.createIndex(row, 0) + bottomRight = self.createIndex(row, self.NUM_COLUMNS-1) + self.dataChanged.emit(topLeft, bottomRight) def headerData(self, section: int, orientation: Qt.Orientation, role: Qt.ItemDataRole): assert orientation == Qt.Horizontal diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py index f5a7b4207..71cde538e 100644 --- a/electrum/gui/qt/main_window.py +++ b/electrum/gui/qt/main_window.py @@ -346,8 +346,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): self.console.showMessage(args[0]) elif event == 'verified': wallet, tx_hash, tx_mined_status = args - if wallet == self.wallet and wallet.up_to_date: - self.history_model.update_item(tx_hash, tx_mined_status) + if wallet == self.wallet: + self.history_model.update_tx_mined_status(tx_hash, tx_mined_status) elif event == 'fee': if self.config.is_dynfee(): self.fee_slider.update()