Browse Source

qml history: update mempool depth for unconf txs on new histogram

master
SomberNight 3 years ago
parent
commit
2de9ca24a2
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 2
      electrum/gui/qml/qenetwork.py
  2. 18
      electrum/gui/qml/qetransactionlistmodel.py

2
electrum/gui/qml/qenetwork.py

@ -118,7 +118,7 @@ class QENetwork(QObject, QtEventListener):
@event_listener
def on_event_fee_histogram(self, histogram):
self._logger.debug(f'fee histogram updated: {repr(histogram)}')
self._logger.debug(f'fee histogram updated')
self.update_histogram(histogram)
def update_histogram(self, histogram):

18
electrum/gui/qml/qetransactionlistmodel.py

@ -242,3 +242,21 @@ class QETransactionListModel(QAbstractListModel, QtEventListener):
self.dataChanged.emit(index, index, roles)
elif tx_item['height'] in (TX_HEIGHT_FUTURE, TX_HEIGHT_LOCAL):
self._update_future_txitem(i)
@qt_event_listener
def on_event_fee_histogram(self, histogram):
self._logger.debug(f'fee histogram updated')
for i, tx_item in enumerate(self.tx_history):
if 'height' not in tx_item: # filter to on-chain
continue
if tx_item['confirmations'] > 0: # filter out already mined
continue
txid = tx_item['txid']
tx = self.wallet.db.get_transaction(txid)
assert tx is not None
txinfo = self.wallet.get_tx_info(tx)
status, status_str = self.wallet.get_tx_status(txid, txinfo.tx_mined_status)
tx_item['date'] = status_str
index = self.index(i, 0)
roles = [self._ROLE_RMAP['date']]
self.dataChanged.emit(index, index, roles)

Loading…
Cancel
Save