![]() |
Master Core
v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
|
UI model for a transaction. More...
#include <transactionrecord.h>
Public Types | |
enum | Type { Other, Generated, SendToAddress, SendToOther, RecvWithAddress, RecvFromOther, SendToSelf } |
Public Member Functions | |
TransactionRecord () | |
TransactionRecord (uint256 hash, qint64 time) | |
TransactionRecord (uint256 hash, qint64 time, Type type, const std::string &address, qint64 debit, qint64 credit) | |
QString | getTxID () const |
Return the unique identifier for this transaction (part) More... | |
void | updateStatus (const CWalletTx &wtx) |
Update status from core wallet tx. More... | |
bool | statusUpdateNeeded () |
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) |
static QString | formatSubTxId (const uint256 &hash, int vout) |
Format subtransaction id. More... | |
Public Attributes | |
int | idx |
Subtransaction index, for sort key. More... | |
TransactionStatus | status |
Status: can change with block chain update. More... | |
Immutable transaction attributes | |
uint256 | hash |
qint64 | time |
Type | type |
std::string | address |
qint64 | debit |
qint64 | credit |
Static Public Attributes | |
static const int | RecommendedNumConfirmations = 6 |
Number of confirmation recommended for accepting a transaction. More... | |
UI model for a transaction.
A core transaction can be represented by multiple UI transactions if it has multiple outputs.
Definition at line 67 of file transactionrecord.h.
Enumerator | |
---|---|
Other | |
Generated | |
SendToAddress | |
SendToOther | |
RecvWithAddress | |
RecvFromOther | |
SendToSelf |
Definition at line 70 of file transactionrecord.h.
|
inline |
Definition at line 84 of file transactionrecord.h.
Referenced by decomposeTransaction().
|
inline |
Definition at line 89 of file transactionrecord.h.
|
inline |
Definition at line 95 of file transactionrecord.h.
|
static |
Definition at line 30 of file transactionrecord.cpp.
References address, credit, debit, ExtractDestination(), Generated, CWalletTx::GetChange(), CWalletTx::GetCredit(), CWalletTx::GetDebit(), CTransaction::GetHash(), CWalletTx::GetTxTime(), CTransaction::GetValueOut(), hash, idx, CTransaction::IsCoinBase(), CWallet::IsMine(), IsMine(), CWalletTx::mapValue, CTxOut::nValue, Other, RecvFromOther, RecvWithAddress, CTxOut::scriptPubKey, SendToAddress, SendToOther, SendToSelf, CBase58Data::ToString(), TransactionRecord(), type, CTransaction::vin, and CTransaction::vout.
Referenced by TransactionTablePriv::refreshWallet(), and TransactionTablePriv::updateWallet().
Format subtransaction id.
Definition at line 247 of file transactionrecord.cpp.
References strprintf, and base_uint< BITS >::ToString().
Referenced by getTxID(), and TransactionDesc::toHTML().
QString TransactionRecord::getTxID | ( | ) | const |
Return the unique identifier for this transaction (part)
Definition at line 242 of file transactionrecord.cpp.
References formatSubTxId(), hash, and idx.
Referenced by TransactionTableModel::data().
|
static |
Decompose CWallet transaction to model transaction records.
Definition at line 14 of file transactionrecord.cpp.
References CTransaction::IsCoinBase(), and CMerkleTx::IsInMainChain().
Referenced by TransactionTablePriv::refreshWallet(), and TransactionTablePriv::updateWallet().
bool TransactionRecord::statusUpdateNeeded | ( | ) |
Return whether a status update is needed.
Definition at line 236 of file transactionrecord.cpp.
References AssertLockHeld, chainActive, cs_main, TransactionStatus::cur_num_blocks, CChain::Height(), and status.
Referenced by TransactionTablePriv::index().
void TransactionRecord::updateStatus | ( | const CWalletTx & | wtx | ) |
Update status from core wallet tx.
Definition at line 151 of file transactionrecord.cpp.
References AssertLockHeld, chainActive, TransactionStatus::Confirmed, TransactionStatus::Confirming, TransactionStatus::Conflicted, TransactionStatus::countsForBalance, cs_main, TransactionStatus::cur_num_blocks, TransactionStatus::depth, Generated, GetAdjustedTime(), CMerkleTx::GetBlocksToMaturity(), CMerkleTx::GetDepthInMainChain(), CWalletTx::GetRequestCount(), CMerkleTx::hashBlock, CChain::Height(), idx, TransactionStatus::Immature, CTransaction::IsCoinBase(), IsFinalTx(), CMerkleTx::IsInMainChain(), CWalletTx::IsTrusted(), LOCKTIME_THRESHOLD, mapBlockIndex, TransactionStatus::matures_in, TransactionStatus::MaturesWarning, CBlockIndex::nHeight, CTransaction::nLockTime, TransactionStatus::NotAccepted, CWalletTx::nTimeReceived, TransactionStatus::Offline, TransactionStatus::open_for, TransactionStatus::OpenUntilBlock, TransactionStatus::OpenUntilDate, RecommendedNumConfirmations, TransactionStatus::sortKey, TransactionStatus::status, status, strprintf, type, and TransactionStatus::Unconfirmed.
Referenced by TransactionTablePriv::index().
std::string TransactionRecord::address |
Definition at line 113 of file transactionrecord.h.
Referenced by TransactionTableModel::addressColor(), TransactionTableModel::data(), decomposeTransaction(), and TransactionTableModel::formatTxToAddress().
qint64 TransactionRecord::credit |
Definition at line 115 of file transactionrecord.h.
Referenced by TransactionTableModel::data(), decomposeTransaction(), and TransactionTableModel::formatTxAmount().
qint64 TransactionRecord::debit |
Definition at line 114 of file transactionrecord.h.
Referenced by TransactionTableModel::data(), decomposeTransaction(), and TransactionTableModel::formatTxAmount().
uint256 TransactionRecord::hash |
Definition at line 110 of file transactionrecord.h.
Referenced by TransactionTableModel::data(), decomposeTransaction(), TransactionTablePriv::describe(), getTxID(), TransactionTablePriv::index(), and TxLessThan::operator()().
int TransactionRecord::idx |
Subtransaction index, for sort key.
Definition at line 119 of file transactionrecord.h.
Referenced by decomposeTransaction(), TransactionTablePriv::describe(), getTxID(), and updateStatus().
|
static |
Number of confirmation recommended for accepting a transaction.
Definition at line 82 of file transactionrecord.h.
Referenced by TransactionTableModel::formatTxStatus(), and updateStatus().
TransactionStatus TransactionRecord::status |
Status: can change with block chain update.
Definition at line 122 of file transactionrecord.h.
Referenced by TransactionTableModel::data(), TransactionTableModel::formatTxAmount(), TransactionTableModel::formatTxStatus(), statusUpdateNeeded(), TransactionTableModel::txStatusDecoration(), and updateStatus().
qint64 TransactionRecord::time |
Definition at line 111 of file transactionrecord.h.
Referenced by TransactionTableModel::data(), and TransactionTableModel::formatTxDate().
Type TransactionRecord::type |
Definition at line 112 of file transactionrecord.h.
Referenced by TransactionTableModel::addressColor(), TransactionTableModel::data(), decomposeTransaction(), TransactionTableModel::formatTooltip(), TransactionTableModel::formatTxToAddress(), TransactionTableModel::formatTxType(), TransactionTableModel::txAddressDecoration(), and updateStatus().