aboutsummaryrefslogtreecommitdiff
path: root/src/qt/transactiontablemodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/transactiontablemodel.cpp')
-rw-r--r--src/qt/transactiontablemodel.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp
index 70dbd0ffec..52c9b0ce84 100644
--- a/src/qt/transactiontablemodel.cpp
+++ b/src/qt/transactiontablemodel.cpp
@@ -394,12 +394,15 @@ QVariant TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx)
return QVariant(description);
}
-QVariant TransactionTableModel::formatTxAmount(const TransactionRecord *wtx) const
+QVariant TransactionTableModel::formatTxAmount(const TransactionRecord *wtx, bool showUnconfirmed) const
{
QString str = QString::fromStdString(FormatMoney(wtx->credit + wtx->debit));
- if(!wtx->status.confirmed || wtx->status.maturity != TransactionStatus::Mature)
+ if(showUnconfirmed)
{
- str = QString("[") + str + QString("]");
+ if(!wtx->status.confirmed || wtx->status.maturity != TransactionStatus::Mature)
+ {
+ str = QString("[") + str + QString("]");
+ }
}
return QVariant(str);
}
@@ -541,6 +544,18 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const
{
return llabs(rec->credit + rec->debit);
}
+ else if (role == TxIDRole)
+ {
+ return QString::fromStdString(rec->getTxID());
+ }
+ else if (role == ConfirmedRole)
+ {
+ return rec->status.status == TransactionStatus::HaveConfirmations;
+ }
+ else if (role == FormattedAmountRole)
+ {
+ return formatTxAmount(rec, false);
+ }
return QVariant();
}