MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / filterAcceptsRow

Method filterAcceptsRow

src/qt/transactionfilterproxy.cpp:19–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19bool TransactionFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
20{
21 QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
22
23 int status = index.data(TransactionTableModel::StatusRole).toInt();
24 if (!showInactive && status == TransactionStatus::Conflicted)
25 return false;
26
27 int type = index.data(TransactionTableModel::TypeRole).toInt();
28 if (!(TYPE(type) & typeFilter))
29 return false;
30
31 QDateTime datetime = index.data(TransactionTableModel::DateRole).toDateTime();
32 if (dateFrom && datetime < *dateFrom) return false;
33 if (dateTo && datetime > *dateTo) return false;
34
35 QString address = index.data(TransactionTableModel::AddressRole).toString();
36 QString label = index.data(TransactionTableModel::LabelRole).toString();
37 QString txid = index.data(TransactionTableModel::TxHashRole).toString();
38 if (!address.contains(m_search_string, Qt::CaseInsensitive) &&
39 ! label.contains(m_search_string, Qt::CaseInsensitive) &&
40 ! txid.contains(m_search_string, Qt::CaseInsensitive)) {
41 return false;
42 }
43
44 qint64 amount = llabs(index.data(TransactionTableModel::AmountRole).toLongLong());
45 if (amount < minAmount)
46 return false;
47
48 return true;
49}
50
51void TransactionFilterProxy::setDateRange(const std::optional<QDateTime>& from, const std::optional<QDateTime>& to)
52{

Callers

nothing calls this directly

Calls 4

indexMethod · 0.45
dataMethod · 0.45
toStringMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected