Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
•All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
transactiontablemodel.cpp
Go to the documentation of this file.
96 qDebug() << "TransactionTablePriv::updateWallet: " + QString::fromStdString(hash.ToString()) + " " + QString::number(status);
117 " showTransaction=" + QString::number(showTransaction) + " derivedStatus=" + QString::number(status);
124 qWarning() << "TransactionTablePriv::updateWallet: Warning: Got CT_NEW, but transaction is already in model";
134 qWarning() << "TransactionTablePriv::updateWallet: Warning: Got CT_NEW, but transaction is not in wallet";
156 qWarning() << "TransactionTablePriv::updateWallet: Warning: Got CT_DELETED, but transaction is not in model";
165 // Miscellaneous updates -- nothing to do, status update will take care of this, and is only computed for
171 Q_EMIT parent->dataChanged(parent->index(lowerIndex, TransactionTableModel::Status), parent->index(upperIndex, TransactionTableModel::Status));
176 void updateAddressBook(const QString& address, const QString& label, bool isMine, const QString& purpose, int status)
183 Q_EMIT parent->dataChanged(parent->index(index, TransactionTableModel::ToAddress), parent->index(index, TransactionTableModel::ToAddress));
259 columns << QString() << QString() << tr("Date") << tr("Type") << tr("Address / Label") << BitcoinUnits::getAmountColumnTitle(walletModel->getOptionsModel()->getDisplayUnit());
262 connect(walletModel->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
276 columns[Amount] = BitcoinUnits::getAmountColumnTitle(walletModel->getOptionsModel()->getDisplayUnit());
280 void TransactionTableModel::updateTransaction(const QString &hash, int status, bool showTransaction)
288 void TransactionTableModel::updateAddressBook(const QString& address, const QString& label, bool isMine,
345 status = tr("Confirming (%1 of %2 recommended confirmations)").arg(wtx->status.depth).arg(TransactionRecord::RecommendedNumConfirmations);
354 status = tr("Immature (%1 confirmations, will be available after %2)").arg(wtx->status.depth).arg(wtx->status.depth + wtx->status.matures_in);
383 QString TransactionTableModel::formatAddressLabel(const std::string &address, const QString& label, bool tooltip) const
439 QString TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx, bool tooltip) const
444 watchAddress = wtx->involvesWatchAddress ? QString(" (") + tr("watch-only") + QString(")") : "";
492 QString TransactionTableModel::formatTxAmount(const TransactionRecord *wtx, bool showUnconfirmed, BitcoinUnits::SeparatorStyle separators) const
494 QString str = BitcoinUnits::format(walletModel->getOptionsModel()->getDisplayUnit(), wtx->credit + wtx->debit, false, separators);
717 QVariant TransactionTableModel::headerData(int section, Qt::Orientation orientation, int role) const
794 static void NotifyTransactionChanged(TransactionTableModel *ttm, CWallet *wallet, const uint256 &hash, ChangeType status)
798 // Determine whether to show transaction or not (determine this here so that no relocking is needed in GUI thread)
812 static void NotifyAddressBookChanged(TransactionTableModel *ttm, CWallet *wallet, const CTxDestination &address, const std::string &label, bool isMine, const std::string &purpose, ChangeType status)
831 QMetaObject::invokeMethod(ttm, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, true));
835 QMetaObject::invokeMethod(ttm, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, false));
846 wallet->NotifyTransactionChanged.connect(boost::bind(NotifyTransactionChanged, this, _1, _2, _3));
847 wallet->NotifyAddressBookChanged.connect(boost::bind(NotifyAddressBookChanged, this, _1, _2, _3, _4, _5, _6));
854 wallet->NotifyTransactionChanged.disconnect(boost::bind(NotifyTransactionChanged, this, _1, _2, _3));
855 wallet->NotifyAddressBookChanged.disconnect(boost::bind(NotifyAddressBookChanged, this, _1, _2, _3, _4, _5, _6));
void updateAmountColumnTitle()
Updates the column title to "Amount (DisplayUnit)" and emits headerDataChanged() signal for table hea...
Definition: transactiontablemodel.cpp:274
QString describe(TransactionRecord *rec, int unit)
Definition: transactiontablemodel.cpp:226
int cachedChainLockHeight
Definition: transactiontablemodel.h:93
TransactionTableModel(CWallet *wallet, WalletModel *parent=0)
Definition: transactiontablemodel.cpp:252
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
Definition: standard.h:80
Confirmed, but waiting for the recommended number of confirmations.
Definition: transactionrecord.h:35
QVariant txWatchonlyDecoration(const TransactionRecord *wtx) const
Definition: transactiontablemodel.cpp:564
Transaction not yet final, waiting for block.
Definition: transactionrecord.h:33
Transaction status (TransactionRecord::Status)
Definition: transactiontablemodel.h:73
QString formatTxAmount(const TransactionRecord *wtx, bool showUnconfirmed=true, BitcoinUnits::SeparatorStyle separators=BitcoinUnits::separatorStandard) const
Definition: transactiontablemodel.cpp:492
static void NotifyTransactionChanged(TransactionTableModel *ttm, CWallet *wallet, const uint256 &hash, ChangeType status)
Definition: transactiontablemodel.cpp:794
QString formatTooltip(const TransactionRecord *rec) const
Definition: transactiontablemodel.cpp:572
QColor getThemedQColor(ThemedColor color)
Helper to get colors for various themes which can't be applied via css for some reason.
Definition: guiutil.cpp:204
bool showTransaction
Definition: transactiontablemodel.cpp:788
Have 6 or more confirmations (normal tx) or fully mature (mined tx)
Definition: transactionrecord.h:30
static void NotifyAddressBookChanged(TransactionTableModel *ttm, CWallet *wallet, const CTxDestination &address, const std::string &label, bool isMine, const std::string &purpose, ChangeType status)
Definition: transactiontablemodel.cpp:812
void updateTransaction(const QString &hash, int status, bool showTransaction)
Definition: transactiontablemodel.cpp:280
void unsubscribeFromCoreSignals()
Definition: transactiontablemodel.cpp:851
QVariant txStatusDecoration(const TransactionRecord *wtx) const
Definition: transactiontablemodel.cpp:528
TransactionRecord * index(int idx)
Definition: transactiontablemodel.cpp:194
bool operator()(const TransactionRecord &a, const TransactionRecord &b) const
Definition: transactiontablemodel.cpp:40
void updateStatus(const CWalletTx &wtx, int chainLockHeight)
Update status from core wallet tx.
Definition: transactionrecord.cpp:267
static bool showTransaction(const CWalletTx &wtx)
Decompose CWallet transaction to model transaction records.
Definition: transactionrecord.cpp:21
AddressTableModel * getAddressTableModel()
Definition: walletmodel.cpp:464
Transaction data, hex-encoded.
Definition: transactiontablemodel.h:65
Date and time this transaction was created in MSec since epoch.
Definition: transactiontablemodel.h:47
void updateWallet(const uint256 &hash, int status, bool showTransaction)
Definition: transactiontablemodel.cpp:94
Long description (HTML format)
Definition: transactiontablemodel.h:53
static QString getAmountColumnTitle(int unit)
Gets title for amount column including current display unit if optionsModel reference available */...
Definition: bitcoinunits.cpp:231
bool operator()(const uint256 &a, const TransactionRecord &b) const
Definition: transactiontablemodel.cpp:48
Definition: transactiontablemodel.cpp:38
QList< TransactionRecord > cachedWallet
Definition: transactiontablemodel.cpp:71
boost::signals2::signal< void(CWallet *wallet, const uint256 &hashTx, ChangeType status)> NotifyTransactionChanged
Wallet transaction added, removed or updated.
Definition: wallet.h:1197
Definition: transactiontablemodel.cpp:55
bool operator()(const TransactionRecord &a, const uint256 &b) const
Definition: transactiontablemodel.cpp:44
void updateChainLockHeight(int chainLockHeight)
Definition: transactiontablemodel.cpp:304
TransactionStatus status
Status: can change with block chain update.
Definition: transactionrecord.h:146
QString formatTxType(const TransactionRecord *wtx) const
Definition: transactiontablemodel.cpp:397
TransactionTablePriv(CWallet *_wallet, TransactionTableModel *_parent)
Definition: transactiontablemodel.cpp:58
void updateDisplayUnit()
Definition: transactiontablemodel.cpp:761
TransactionNotification()
Definition: transactiontablemodel.cpp:772
Whole transaction as plain text.
Definition: transactiontablemodel.h:67
static QList< TransactionRecord > decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx)
Definition: transactionrecord.cpp:31
static void ShowProgress(TransactionTableModel *ttm, const std::string &title, int nProgress)
Definition: transactiontablemodel.cpp:822
QString getTxID() const
Return the unique identifier for this transaction (part)
Definition: transactionrecord.cpp:378
Definition: ui_interface.h:23
void updateAddressBook(const QString &address, const QString &label, bool isMine, const QString &purpose, int status)
Definition: transactiontablemodel.cpp:288
QIcon getIcon(const QString &strIcon, const ThemedColor color, const ThemedColor colorAlternative, const QString &strIconPath)
Helper to get an icon colorized with the given color (replaces black) and colorAlternative (replaces ...
Definition: guiutil.cpp:216
Is transaction confirmed?
Definition: transactiontablemodel.h:69
TransactionNotification(uint256 _hash, ChangeType _status, bool _showTransaction)
Definition: transactiontablemodel.cpp:773
bool countsForBalance
Transaction counts towards available balance.
Definition: transactionrecord.h:44
QString getTxHex(TransactionRecord *rec)
Definition: transactiontablemodel.cpp:239
Date and time this transaction was created.
Definition: transactiontablemodel.h:45
int getChainLockHeight() const
Definition: transactiontablemodel.cpp:309
UI model for the transaction table of a wallet.
Definition: transactiontablemodel.h:21
Normal (sent/received) transactions.
Definition: transactionrecord.h:32
~TransactionTableModel()
Definition: transactiontablemodel.cpp:267
void subscribeToCoreSignals()
Definition: transactiontablemodel.cpp:843
Definition: bitcoinunits.h:68
QString formatAddressLabel(const std::string &address, const QString &label, bool tooltip) const
Definition: transactiontablemodel.cpp:383
Definition: transactionrecord.h:85
QVariant data(const QModelIndex &index, int role) const
Definition: transactiontablemodel.cpp:583
Definition: ui_interface.h:24
static std::vector< TransactionNotification > vQueueNotifications
Definition: transactiontablemodel.cpp:792
std::string EncodeDestination(const CTxDestination &dest)
Definition: base58.cpp:329
QString formatTxToAddress(const TransactionRecord *wtx, bool tooltip) const
Definition: transactiontablemodel.cpp:439
boost::signals2::signal< void(CWallet *wallet, const CTxDestination &address, const std::string &label, bool isMine, const std::string &purpose, ChangeType status)> NotifyAddressBookChanged
Address book entry changed.
Definition: wallet.h:1190
Definition: ui_interface.h:22
Conflicts with other transaction or mempool.
Definition: transactionrecord.h:36
int columnCount(const QModelIndex &parent) const
Definition: transactiontablemodel.cpp:320
int rowCount(const QModelIndex &parent) const
Definition: transactiontablemodel.cpp:314
bool involvesWatchAddress
Whether the transaction was sent/received with a watch-only address.
Definition: transactionrecord.h:149
QVariant headerData(int section, Qt::Orientation orientation, int role) const
Definition: transactiontablemodel.cpp:717
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
Definition: wallet.h:715
Label of address related to transaction.
Definition: transactiontablemodel.h:57
QString labelForDestination(const CTxDestination &dest) const
Definition: addresstablemodel.cpp:430
boost::signals2::signal< void(const std::string &title, int nProgress)> ShowProgress
Show progress e.g.
Definition: wallet.h:1200
QString formatTxStatus(const TransactionRecord *wtx) const
Definition: transactiontablemodel.cpp:326
bool statusUpdateNeeded(int chainLockHeight) const
Return whether a status update is needed.
Definition: transactionrecord.cpp:371
QVariant addressColor(const TransactionRecord *wtx) const
Definition: transactiontablemodel.cpp:465
qint64 open_for
Timestamp if status==OpenUntilDate, otherwise number of additional blocks that need to be mined befor...
Definition: transactionrecord.h:63
QVariant txAddressDecoration(const TransactionRecord *wtx) const
Definition: transactiontablemodel.cpp:431
Formatted amount, without brackets when unconfirmed.
Definition: transactiontablemodel.h:71
void updateConfirmations()
Definition: transactiontablemodel.cpp:294
QVariant amountColor(const TransactionRecord *rec) const
Definition: transactiontablemodel.cpp:505
static QString toHTML(CWallet *wallet, CWalletTx &wtx, TransactionRecord *rec, int unit)
Definition: transactiondesc.cpp:63
Definition: bitcoinunits.h:70
static const int RecommendedNumConfirmations
Number of confirmation recommended for accepting a transaction.
Definition: transactionrecord.h:101
void updateAddressBook(const QString &address, const QString &label, bool isMine, const QString &purpose, int status)
Definition: transactiontablemodel.cpp:176
static QString format(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as string.
Definition: bitcoinunits.cpp:119
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Definition: transactiontablemodel.cpp:750
QString formatTxDate(const TransactionRecord *wtx) const
Definition: transactiontablemodel.cpp:371
Watch-only icon.
Definition: transactiontablemodel.h:51