Browse Source

qt history list: optimise fee histogram induced refresh

3.3.3.1
SomberNight 6 years ago
parent
commit
a99b92f613
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 9
      electrum/gui/qt/history_list.py
  2. 2
      electrum/gui/qt/main_window.py

9
electrum/gui/qt/history_list.py

@ -257,6 +257,15 @@ class HistoryModel(QAbstractItemModel, PrintError):
bottomRight = self.createIndex(row, self.NUM_COLUMNS-1)
self.dataChanged.emit(topLeft, bottomRight)
def on_fee_histogram(self):
for tx_hash, tx_item in self.transactions.items():
tx_mined_info = self.tx_mined_info_from_tx_item(tx_item)
if tx_mined_info.conf > 0:
# note: we could actually break here if we wanted to rely on the order of txns in self.transactions
continue
self.tx_status_cache[tx_hash] = self.parent.wallet.get_tx_status(tx_hash, tx_mined_info)
self.update_tx_mined_status(tx_hash, tx_mined_info)
def headerData(self, section: int, orientation: Qt.Orientation, role: Qt.ItemDataRole):
assert orientation == Qt.Horizontal
if role != Qt.DisplayRole:

2
electrum/gui/qt/main_window.py

@ -356,7 +356,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
if self.config.is_dynfee():
self.fee_slider.update()
self.do_update_fee()
self.history_model.refresh('fee_histogram')
self.history_model.on_fee_histogram()
else:
self.print_error("unexpected network_qt signal:", event, args)

Loading…
Cancel
Save