mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 01:11:35 +00:00
qt history list: optimise update_item (tx mined status)
This commit is contained in:
parent
b1e15751d6
commit
696db310a5
2 changed files with 11 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue