@@ -106,10 +106,11 @@ class TransactionTablePriv
106106
107107 /* Query entire wallet anew from core.
108108 */
109- void refreshWallet (interfaces::Wallet& wallet)
109+ void refreshWallet (interfaces::Wallet& wallet, bool force = false )
110110 {
111111 parent->beginResetModel ();
112- assert (!m_loaded);
112+ assert (!m_loaded || force);
113+ cachedWallet.clear ();
113114 try {
114115 for (const auto & wtx : wallet.getWalletTxs ()) {
115116 if (TransactionRecord::showTransaction ()) {
@@ -121,7 +122,9 @@ class TransactionTablePriv
121122 }
122123 parent->endResetModel ();
123124 m_loaded = true ;
124- DispatchNotifications ();
125+ if (!force) {
126+ DispatchNotifications ();
127+ }
125128 }
126129
127130 /* Update our model of the wallet incrementally, to synchronize our model of the wallet
@@ -284,9 +287,9 @@ TransactionTableModel::~TransactionTableModel()
284287 delete priv;
285288}
286289
287- void TransactionTableModel::refreshWallet ()
290+ void TransactionTableModel::refreshWallet (bool force )
288291{
289- priv->refreshWallet (walletModel->wallet ());
292+ priv->refreshWallet (walletModel->wallet (), force );
290293}
291294
292295/* * Updates the column title to "Amount (DisplayUnit)" and emits headerDataChanged() signal for table headers to react. */
@@ -848,7 +851,7 @@ void TransactionTablePriv::DispatchNotifications()
848851 }
849852 } else {
850853 // it's much faster to just refresh the whole thing instead
851- bool invoked = QMetaObject::invokeMethod (parent, " refreshWallet" , Qt::QueuedConnection);
854+ bool invoked = QMetaObject::invokeMethod (parent, " refreshWallet" , Qt::QueuedConnection, Q_ARG ( bool , true ) );
852855 assert (invoked);
853856 }
854857 vQueueNotifications.clear ();
0 commit comments