Skip to content

Commit 7d54ae4

Browse files
UI: Cap scope of recent wallet txs at 500 by default
1 parent a0f3a14 commit 7d54ae4

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/qt/tradehistorydialog.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,11 @@ int TradeHistoryDialog::PopulateTradeHistoryMap()
268268
// ### START WALLET TRANSACTIONS PROCESSING ###
269269
std::list<CAccountingEntry> acentries;
270270
CWallet::TxItems txOrdered = pwalletMain->OrderedTxItems(acentries, "*");
271+
// iterate through wallet entries backwards, limiting to most recent n (default 500) transactions (override with --omniuiwalletscope=n)
272+
int walletTxCount = 0, walletTxMax = GetArg("-omniuiwalletscope", 500);
271273
for (CWallet::TxItems::reverse_iterator it = txOrdered.rbegin(); it != txOrdered.rend(); ++it) {
274+
if (walletTxCount >= walletTxMax) break;
275+
++walletTxCount;
272276
CWalletTx *const pwtx = (*it).second.first;
273277
if (pwtx == 0) continue;
274278
uint256 hash = pwtx->GetHash();

src/qt/txhistorydialog.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ TXHistoryDialog::TXHistoryDialog(QWidget *parent) :
8787
ui->txHistoryTable->horizontalHeader()->setSectionResizeMode(6, QHeaderView::Interactive);
8888
#endif
8989
ui->txHistoryTable->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
90+
ui->txHistoryTable->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
9091
ui->txHistoryTable->verticalHeader()->setVisible(false);
9192
ui->txHistoryTable->setSelectionBehavior(QAbstractItemView::SelectRows);
9293
ui->txHistoryTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
@@ -210,11 +211,14 @@ int TXHistoryDialog::PopulateHistoryMap()
210211
std::vector<std::string> vecReceipts;
211212
boost::split(vecReceipts, mySTOReceipts, boost::is_any_of(","), boost::token_compress_on);
212213
int64_t lastTXBlock = 999999; // set artificially high initially until first wallet tx is processed
213-
// iterate through wallet entries backwards
214+
// iterate through wallet entries backwards, limiting to most recent n (default 500) transactions (override with --omniuiwalletscope=n)
215+
int walletTxCount = 0, walletTxMax = GetArg("-omniuiwalletscope", 500);
214216
std::list<CAccountingEntry> acentries;
215217
CWallet::TxItems txOrdered = pwalletMain->OrderedTxItems(acentries, "*");
216218
for (CWallet::TxItems::reverse_iterator it = txOrdered.rbegin(); it != txOrdered.rend(); ++it) {
217219
CWalletTx *const pwtx = (*it).second.first;
220+
if (walletTxCount >= walletTxMax) break;
221+
++walletTxCount;
218222
if (pwtx != 0) {
219223
uint256 hash = pwtx->GetHash();
220224
// check txlistdb, if not there it's not a confirmed Omni transaction so move to next transaction

0 commit comments

Comments
 (0)