Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
UI model for a transaction. More...
#include <transactionrecord.h>
Public Member Functions | |
TransactionRecord () | |
TransactionRecord (uint256 _hash, qint64 _time) | |
TransactionRecord (uint256 _hash, qint64 _time, Type _type, const std::string &_strAddress, const CAmount &_debit, const CAmount &_credit) | |
QString | getTxID () const |
Return the unique identifier for this transaction (part) More... | |
int | getOutputIndex () const |
Return the output index of the subtransaction. More... | |
void | updateStatus (const CWalletTx &wtx, int chainLockHeight) |
Update status from core wallet tx. More... | |
bool | statusUpdateNeeded (int chainLockHeight) const |
Return whether a status update is needed. More... | |
Static Public Member Functions | |
static bool | showTransaction (const CWalletTx &wtx) |
Decompose CWallet transaction to model transaction records. More... | |
static QList< TransactionRecord > | decomposeTransaction (const CWallet *wallet, const CWalletTx &wtx) |
Public Attributes | |
int | idx |
Subtransaction index, for sort key. More... | |
TransactionStatus | status |
Status: can change with block chain update. More... | |
bool | involvesWatchAddress |
Whether the transaction was sent/received with a watch-only address. More... | |
Immutable transaction attributes | |
uint256 | hash |
qint64 | time |
Type | type |
std::string | strAddress |
CTxDestination | txDest |
CAmount | debit |
CAmount | credit |
Static Public Attributes | |
static const int | RecommendedNumConfirmations = 6 |
Number of confirmation recommended for accepting a transaction. More... | |
Detailed Description
UI model for a transaction.
A core transaction can be represented by multiple UI transactions if it has multiple outputs.
Definition at line 80 of file transactionrecord.h.
Member Enumeration Documentation
◆ Type
Definition at line 83 of file transactionrecord.h.
Constructor & Destructor Documentation
◆ TransactionRecord() [1/3]
|
inline |
Definition at line 103 of file transactionrecord.h.
References DecodeDestination(), strAddress, and txDest.
Referenced by decomposeTransaction().
◆ TransactionRecord() [2/3]
|
inline |
Definition at line 109 of file transactionrecord.h.
References DecodeDestination(), strAddress, and txDest.
◆ TransactionRecord() [3/3]
|
inline |
Definition at line 116 of file transactionrecord.h.
References DecodeDestination(), strAddress, and txDest.
Member Function Documentation
◆ decomposeTransaction()
|
static |
Definition at line 31 of file transactionrecord.cpp.
References credit, debit, DecodeDestination(), EncodeDestination(), ExtractDestination(), Generated, CWalletTx::GetChange(), CPrivateSend::GetCollateralAmount(), CWalletTx::GetCredit(), CWalletTx::GetDebit(), CMerkleTx::GetHash(), CPrivateSend::GetMaxCollateralAmount(), CWalletTx::GetTxTime(), hash, idx, involvesWatchAddress, CMerkleTx::IsCoinBase(), CPrivateSend::IsCollateralAmount(), CWallet::IsDenominated(), CPrivateSend::IsDenominatedAmount(), IsMine(), CWallet::IsMine(), ISMINE_ALL, ISMINE_SPENDABLE, ISMINE_WATCH_ONLY, CWalletTx::mapValue, CTxOut::nValue, Other, CTxIn::prevout, PrivateSend, PrivateSendCollateralPayment, PrivateSendCreateDenominations, PrivateSendDenominate, PrivateSendMakeCollaterals, RecvFromOther, RecvWithAddress, CTxOut::scriptPubKey, SendToAddress, SendToOther, SendToSelf, strAddress, TransactionRecord(), CMerkleTx::tx, txDest, and type.
Referenced by TransactionTablePriv::refreshWallet(), and TransactionTablePriv::updateWallet().
◆ getOutputIndex()
int TransactionRecord::getOutputIndex | ( | ) | const |
Return the output index of the subtransaction.
Definition at line 383 of file transactionrecord.cpp.
References idx.
Referenced by TransactionDesc::toHTML().
◆ getTxID()
QString TransactionRecord::getTxID | ( | ) | const |
Return the unique identifier for this transaction (part)
Definition at line 378 of file transactionrecord.cpp.
References hash, and base_blob< BITS >::ToString().
Referenced by TransactionTableModel::data(), and TransactionDesc::toHTML().
◆ showTransaction()
|
static |
Decompose CWallet transaction to model transaction records.
Definition at line 21 of file transactionrecord.cpp.
Referenced by NotifyTransactionChanged(), and TransactionTablePriv::refreshWallet().
◆ statusUpdateNeeded()
bool TransactionRecord::statusUpdateNeeded | ( | int | chainLockHeight | ) | const |
Return whether a status update is needed.
Definition at line 371 of file transactionrecord.cpp.
References AssertLockHeld(), TransactionStatus::cachedChainLockHeight, chainActive, cs_main, TransactionStatus::cur_num_blocks, CChain::Height(), TransactionStatus::lockedByChainLocks, TransactionStatus::needsUpdate, and status.
Referenced by TransactionTablePriv::index().
◆ updateStatus()
void TransactionRecord::updateStatus | ( | const CWalletTx & | wtx, |
int | chainLockHeight | ||
) |
Update status from core wallet tx.
Definition at line 267 of file transactionrecord.cpp.
References TransactionStatus::Abandoned, AssertLockHeld(), TransactionStatus::cachedChainLockHeight, chainActive, CheckFinalTx(), TransactionStatus::Confirmed, TransactionStatus::Confirming, TransactionStatus::Conflicted, TransactionStatus::countsForBalance, cs_main, CWallet::cs_wallet, TransactionStatus::cur_num_blocks, TransactionStatus::depth, Generated, CMerkleTx::GetBlocksToMaturity(), CMerkleTx::GetDepthInMainChain(), CWalletTx::GetWallet(), CMerkleTx::hashBlock, CChain::Height(), idx, TransactionStatus::Immature, CMerkleTx::isAbandoned(), CMerkleTx::IsChainLocked(), CMerkleTx::IsCoinBase(), CMerkleTx::IsInMainChain(), CMerkleTx::IsLockedByInstantSend(), CWalletTx::IsTrusted(), TransactionStatus::label, TransactionStatus::lockedByChainLocks, TransactionStatus::lockedByInstantSend, LOCKTIME_THRESHOLD, CWallet::mapAddressBook, mapBlockIndex, TransactionStatus::matures_in, TransactionStatus::needsUpdate, TransactionStatus::NotAccepted, CWalletTx::nTimeReceived, TransactionStatus::open_for, TransactionStatus::OpenUntilBlock, TransactionStatus::OpenUntilDate, RecommendedNumConfirmations, TransactionStatus::sortKey, TransactionStatus::status, status, strprintf, CMerkleTx::tx, txDest, type, and TransactionStatus::Unconfirmed.
Referenced by TransactionTablePriv::index().
Member Data Documentation
◆ credit
CAmount TransactionRecord::credit |
Definition at line 139 of file transactionrecord.h.
Referenced by TransactionTableModel::data(), decomposeTransaction(), and TransactionTableModel::formatTxAmount().
◆ debit
CAmount TransactionRecord::debit |
Definition at line 138 of file transactionrecord.h.
Referenced by TransactionTableModel::data(), decomposeTransaction(), and TransactionTableModel::formatTxAmount().
◆ hash
uint256 TransactionRecord::hash |
Definition at line 132 of file transactionrecord.h.
Referenced by TransactionTableModel::data(), decomposeTransaction(), TransactionTablePriv::describe(), TransactionTablePriv::getTxHex(), getTxID(), TransactionTablePriv::index(), and TxLessThan::operator()().
◆ idx
int TransactionRecord::idx |
Subtransaction index, for sort key.
Definition at line 143 of file transactionrecord.h.
Referenced by decomposeTransaction(), getOutputIndex(), and updateStatus().
◆ involvesWatchAddress
bool TransactionRecord::involvesWatchAddress |
Whether the transaction was sent/received with a watch-only address.
Definition at line 149 of file transactionrecord.h.
Referenced by TransactionTableModel::data(), decomposeTransaction(), TransactionTableModel::formatTxToAddress(), and TransactionTableModel::txWatchonlyDecoration().
◆ RecommendedNumConfirmations
|
static |
Number of confirmation recommended for accepting a transaction.
Definition at line 101 of file transactionrecord.h.
Referenced by TransactionTableModel::formatTxStatus(), and updateStatus().
◆ status
TransactionStatus TransactionRecord::status |
Status: can change with block chain update.
Definition at line 146 of file transactionrecord.h.
Referenced by TransactionTableModel::data(), TransactionTableModel::formatTxAmount(), TransactionTableModel::formatTxStatus(), TransactionTableModel::formatTxToAddress(), statusUpdateNeeded(), TransactionTableModel::txAddressDecoration(), TransactionTableModel::txStatusDecoration(), TransactionTablePriv::updateAddressBook(), updateStatus(), and TransactionTablePriv::updateWallet().
◆ strAddress
std::string TransactionRecord::strAddress |
Definition at line 135 of file transactionrecord.h.
Referenced by TransactionTableModel::data(), decomposeTransaction(), TransactionTableModel::formatTxToAddress(), TransactionDesc::toHTML(), and TransactionRecord().
◆ time
qint64 TransactionRecord::time |
Definition at line 133 of file transactionrecord.h.
Referenced by TransactionTableModel::data(), and TransactionTableModel::formatTxDate().
◆ txDest
CTxDestination TransactionRecord::txDest |
Definition at line 136 of file transactionrecord.h.
Referenced by TransactionTableModel::addressColor(), decomposeTransaction(), TransactionRecord(), and updateStatus().
◆ type
Type TransactionRecord::type |
Definition at line 134 of file transactionrecord.h.
Referenced by TransactionTableModel::addressColor(), TransactionTableModel::amountColor(), TransactionTableModel::data(), decomposeTransaction(), TransactionTableModel::formatTooltip(), TransactionTableModel::formatTxToAddress(), TransactionTableModel::formatTxType(), and updateStatus().
The documentation for this class was generated from the following files:
- src/qt/transactionrecord.h
- src/qt/transactionrecord.cpp