qml: fix refresh bug in history, for local->unconfirmed tx transition
Previously if a local tx got broadcast, it was still displayed as local in the history until it got mined (or some other action forced a full refresh).
This commit is contained in:
@@ -439,6 +439,10 @@ class AddressSynchronizer(Logger, EventListener):
|
|||||||
if tx is None:
|
if tx is None:
|
||||||
continue
|
continue
|
||||||
self.add_transaction(tx, allow_unrelated=True, is_new=False)
|
self.add_transaction(tx, allow_unrelated=True, is_new=False)
|
||||||
|
# if we already had this tx, see if its height changed (e.g. local->unconfirmed)
|
||||||
|
old_height = old_hist.get(tx_hash, None)
|
||||||
|
if old_height is not None and old_height != tx_height:
|
||||||
|
util.trigger_callback('adb_tx_height_changed', self, tx_hash, old_height, tx_height)
|
||||||
|
|
||||||
# Store fees
|
# Store fees
|
||||||
for tx_hash, fee_sat in tx_fees.items():
|
for tx_hash, fee_sat in tx_fees.items():
|
||||||
|
|||||||
@@ -181,9 +181,15 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
|
|||||||
self._logger.info(f'new transaction {tx.txid()}')
|
self._logger.info(f'new transaction {tx.txid()}')
|
||||||
self.add_tx_notification(tx)
|
self.add_tx_notification(tx)
|
||||||
self.addressModel.setDirty()
|
self.addressModel.setDirty()
|
||||||
self.historyModel.setDirty() # assuming wallet.is_up_to_date triggers after
|
self.historyModel.setDirty() # assuming wallet.is_up_to_date triggers after
|
||||||
self.balanceChanged.emit()
|
self.balanceChanged.emit()
|
||||||
|
|
||||||
|
@qt_event_listener
|
||||||
|
def on_event_adb_tx_height_changed(self, adb, txid, old_height, new_height):
|
||||||
|
if adb == self.wallet.adb:
|
||||||
|
self._logger.info(f'tx_height_changed {txid}. {old_height} -> {new_height}')
|
||||||
|
self.historyModel.setDirty() # assuming wallet.is_up_to_date triggers after
|
||||||
|
|
||||||
@qt_event_listener
|
@qt_event_listener
|
||||||
def on_event_removed_transaction(self, wallet, tx):
|
def on_event_removed_transaction(self, wallet, tx):
|
||||||
if wallet == self.wallet:
|
if wallet == self.wallet:
|
||||||
|
|||||||
Reference in New Issue
Block a user