diff --git a/electrum/gui/qt/history_list.py b/electrum/gui/qt/history_list.py index 00e7c0695..4d7425301 100644 --- a/electrum/gui/qt/history_list.py +++ b/electrum/gui/qt/history_list.py @@ -317,6 +317,13 @@ class HistoryModel(CustomModel, Logger): balance += node._data['value'].value node._data['balance'] = Satoshis(balance) + # update tx_status_cache + self.tx_status_cache.clear() + for txid, tx_item in transactions.items(): + if not tx_item.get('lightning', False): + tx_mined_info = self._tx_mined_info_from_tx_item(tx_item) + self.tx_status_cache[txid] = self.window.wallet.get_tx_status(txid, tx_mined_info) + new_length = self._root.childCount() self.beginInsertRows(QModelIndex(), 0, new_length-1) self.transactions = transactions @@ -336,12 +343,6 @@ class HistoryModel(CustomModel, Logger): end_date = self.transactions.value_from_pos(len(self.transactions) - 1).get('date') or end_date self.view.years = [str(i) for i in range(start_date.year, end_date.year + 1)] self.view.period_combo.insertItems(1, self.view.years) - # update tx_status_cache - self.tx_status_cache.clear() - for txid, tx_item in self.transactions.items(): - if not tx_item.get('lightning', False): - tx_mined_info = self._tx_mined_info_from_tx_item(tx_item) - self.tx_status_cache[txid] = self.window.wallet.get_tx_status(txid, tx_mined_info) # update counter num_tx = len(self.transactions) if self.view: