Skip to content

Commit 369d4cc

Browse files
committed
re-implement MempoolTxTableModel
1 parent f6eef54 commit 369d4cc

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

src/qt/mempooldetail.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <qt/mempoolconstants.h>
1414
#include <qt/mempooldetail.h>
1515
#include <qt/platformstyle.h>
16+
#include <interfaces/wallet.h>
1617
#include <qt/mempooltxtables.h>
1718

1819

@@ -162,11 +163,8 @@ void MempoolDetail::updateTxTable()
162163
{
163164
if (m_clientmodel) {
164165
QMutexLocker locker(&m_clientmodel->m_mempool_locker);
165-
// Assuming m_wallet_transactions in ClientModel is updated via MempoolStats::onWalletTxChanged
166-
// and ClientModel::walletTxChanged signal is emitted.
167-
// For now, we'll pass the raw set of wallet transactions.
168-
// Further filtering for 'in mempool' status can be done in MempoolTxTableModel if needed.
169-
m_tx_table_model->updateModel(m_clientmodel->m_wallet_transactions);
166+
bool has_active_wallet = !m_clientmodel->node().walletLoader().getWallets().empty();
167+
m_tx_table_model->updateModel(m_clientmodel->m_wallet_transactions, has_active_wallet);
170168
}
171169
}
172170

src/qt/mempooltxtables.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ QModelIndex MempoolTxTableModel::index(int row, int column, const QModelIndex& p
108108
return QModelIndex();
109109
}
110110

111-
void MempoolTxTableModel::updateModel(const std::set<interfaces::WalletTx>& wallet_transactions)
111+
void MempoolTxTableModel::updateModel(const std::set<interfaces::WalletTx>& wallet_transactions, bool has_active_wallet)
112112
{
113113
beginResetModel();
114114
m_tx_data.clear();
115115

116-
if (wallet_transactions.empty()) {
116+
if (!has_active_wallet || wallet_transactions.empty()) {
117117
endResetModel();
118118
return;
119119
}

src/qt/mempooltxtables.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class MempoolTxTableModel : public QAbstractTableModel
4444
/*@}*/
4545

4646
public Q_SLOTS:
47-
void updateModel(const std::set<interfaces::WalletTx>& wallet_transactions);
47+
void updateModel(const std::set<interfaces::WalletTx>& wallet_transactions, bool has_active_wallet);
4848

4949
private:
5050
QList<interfaces::WalletTx> m_tx_data;

0 commit comments

Comments
 (0)