Skip to content

Commit eac2abc

Browse files
committed
Qt: Enable searching by transaction id
1 parent c407c61 commit eac2abc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/qt/transactionfilterproxy.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ bool TransactionFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex &
3838
bool involvesWatchAddress = index.data(TransactionTableModel::WatchonlyRole).toBool();
3939
QString address = index.data(TransactionTableModel::AddressRole).toString();
4040
QString label = index.data(TransactionTableModel::LabelRole).toString();
41+
QString txid = index.data(TransactionTableModel::TxIDRole).toString();
4142
qint64 amount = llabs(index.data(TransactionTableModel::AmountRole).toLongLong());
4243
int status = index.data(TransactionTableModel::StatusRole).toInt();
4344

@@ -51,8 +52,11 @@ bool TransactionFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex &
5152
return false;
5253
if(datetime < dateFrom || datetime > dateTo)
5354
return false;
54-
if (!address.contains(m_search_string, Qt::CaseInsensitive) && !label.contains(m_search_string, Qt::CaseInsensitive))
55+
if (!address.contains(m_search_string, Qt::CaseInsensitive) &&
56+
! label.contains(m_search_string, Qt::CaseInsensitive) &&
57+
! txid.contains(m_search_string, Qt::CaseInsensitive)) {
5558
return false;
59+
}
5660
if(amount < minAmount)
5761
return false;
5862

src/qt/transactionview.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
9797

9898
search_widget = new QLineEdit(this);
9999
#if QT_VERSION >= 0x040700
100-
search_widget->setPlaceholderText(tr("Enter address or label to search"));
100+
search_widget->setPlaceholderText(tr("Enter address, transaction id, or label to search"));
101101
#endif
102102
hlayout->addWidget(search_widget);
103103

0 commit comments

Comments
 (0)