Browse Source

qml: update history in more cases when saving/removing tx

master
Sander van Grieken 3 years ago
parent
commit
ad26d809a4
  1. 2
      electrum/gui/qml/qetxdetails.py
  2. 5
      electrum/gui/qml/qewallet.py

2
electrum/gui/qml/qetxdetails.py

@ -354,6 +354,7 @@ class QETxDetails(QObject, QtEventListener):
self._wallet.wallet.adb.remove_transaction(txid) self._wallet.wallet.adb.remove_transaction(txid)
self._wallet.wallet.save_db() self._wallet.wallet.save_db()
self._wallet.historyModel.init_model(True)
@pyqtSlot() @pyqtSlot()
def save(self): def save(self):
@ -367,6 +368,7 @@ class QETxDetails(QObject, QtEventListener):
return return
self._wallet.wallet.save_db() self._wallet.wallet.save_db()
self.saveTxSuccess.emit() self.saveTxSuccess.emit()
self._wallet.historyModel.init_model(True)
except AddTransactionException as e: except AddTransactionException as e:
self.saveTxError.emit('error', str(e)) self.saveTxError.emit('error', str(e))
finally: finally:

5
electrum/gui/qml/qewallet.py

@ -513,10 +513,13 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
if not tx.is_complete(): if not tx.is_complete():
self._logger.debug('tx not complete') self._logger.debug('tx not complete')
return broadcast = False
if broadcast: if broadcast:
self.broadcast(tx) self.broadcast(tx)
else:
# not broadcasted, so add to history now
self.historyModel.init_model(True)
# this assumes a 2fa wallet, but there are no other tc_sign_wrapper hooks, so that's ok # this assumes a 2fa wallet, but there are no other tc_sign_wrapper hooks, so that's ok
def on_sign_complete(self, broadcast, tx): def on_sign_complete(self, broadcast, tx):

Loading…
Cancel
Save