File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -430,16 +430,19 @@ void MempoolStats::onWalletTxChanged()
430430{
431431 {
432432 QMutexLocker locker (&m_wallet_tx_mutex);
433- m_wallet_transactions.clear ();
434433 if (m_clientmodel) {
434+ m_clientmodel->m_wallet_transactions .clear (); // Clear ClientModel's transactions
435435 for (std::unique_ptr<interfaces::Wallet>& wallet_ptr : m_clientmodel->node ().walletLoader ().getWallets ()) {
436436 if (!wallet_ptr) continue ;
437437 for (const interfaces::WalletTx& wtx : wallet_ptr->getWalletTxs ()) {
438- m_wallet_transactions.insert (wtx);
438+ m_clientmodel-> m_wallet_transactions .insert (wtx); // Populate ClientModel's transactions
439439 }
440440 }
441+ m_wallet_transactions = m_clientmodel->m_wallet_transactions ; // Keep MempoolStats's local copy in sync for indicators
441442 }
442443 }
443444 QMetaObject::invokeMethod (this , " drawChart" , Qt::QueuedConnection);
444- Q_EMIT walletTxChanged ();
445+ if (m_clientmodel) {
446+ Q_EMIT m_clientmodel->walletTxChanged (); // Emit ClientModel's signal
447+ }
445448}
Original file line number Diff line number Diff line change @@ -112,6 +112,12 @@ void MempoolTxTableModel::updateModel(const std::set<interfaces::WalletTx>& wall
112112{
113113 beginResetModel ();
114114 m_tx_data.clear ();
115+
116+ if (wallet_transactions.empty ()) {
117+ endResetModel ();
118+ return ;
119+ }
120+
115121 for (const auto & wtx : wallet_transactions) {
116122 // Only add transactions that are currently in the mempool
117123 // This logic might need to be more sophisticated if we want to show other statuses
You can’t perform that action at this time.
0 commit comments