![]() |
PIVX Core
5.6.99
P2P Digital Currency
|
UI model for a transaction. More...
#include <transactionrecord.h>
Public Types | |
| enum | Type : uint16_t { Other = 0 , Generated , StakeMint , StakeZPIV , SendToAddress , SendToOther , RecvWithAddress , MNReward , BudgetPayment , RecvFromOther , SendToSelf , ZerocoinMint , ZerocoinSpend , RecvFromZerocoinSpend , ZerocoinSpend_Change_zPiv , ZerocoinSpend_FromMe , StakeDelegated , StakeHot , P2CSDelegation , P2CSDelegationSent , P2CSDelegationSentOwner , P2CSUnlockOwner , P2CSUnlockStaker , SendToShielded , RecvWithShieldedAddress , RecvWithShieldedAddressMemo , SendToSelfShieldedAddress , SendToSelfShieldToTransparent , SendToSelfShieldToShieldChangeAddress , SendToNobody } |
Public Member Functions | |
| TransactionRecord (unsigned int size) | |
| TransactionRecord (uint256 hash, qint64 time, unsigned int size) | |
| TransactionRecord (uint256 hash, qint64 time, unsigned int size, Type type, const std::string &address, const CAmount &debit, const CAmount &credit) | |
| int | getOutputIndex () const |
| Return the output index of the subtransaction More... | |
| void | updateStatus (const CWalletTx &wtx, int chainHeight) |
| Update status from core wallet tx. More... | |
| bool | statusUpdateNeeded (int blockHeight) const |
| Return whether a status update is needed. More... | |
| std::string | statusToString () |
| Return transaction status. More... | |
| bool | isCoinStake () const |
| Return true if the tx is a coinstake. More... | |
| bool | isMNReward () const |
| Return true if the tx is a MN reward. More... | |
| bool | isAnyColdStakingType () const |
| Return true if the tx is a any cold staking type tx. More... | |
| bool | isNull () const |
| Return true if the tx hash is null and/or if the size is 0. More... | |
Static Public Member Functions | |
| static QList< TransactionRecord > | decomposeTransaction (const CWallet *wallet, const CWalletTx &wtx) |
| Decompose CWallet transaction to model transaction records. More... | |
| static bool | decomposeCoinStake (const CWallet *wallet, const CWalletTx &wtx, const CAmount &nCredit, const CAmount &nDebit, QList< TransactionRecord > &parts) |
| Helpers. More... | |
| static bool | decomposeZcSpendTx (const CWallet *wallet, const CWalletTx &wtx, const CAmount &nCredit, const CAmount &nDebit, QList< TransactionRecord > &parts) |
| static bool | decomposeP2CS (const CWallet *wallet, const CWalletTx &wtx, const CAmount &nCredit, const CAmount &nDebit, QList< TransactionRecord > &parts) |
| static bool | decomposeCreditTransaction (const CWallet *wallet, const CWalletTx &wtx, QList< TransactionRecord > &parts) |
| Decompose a credit transaction into a record for each received output. More... | |
| static bool | decomposeSendToSelfTransaction (const CWalletTx &wtx, const CAmount &nCredit, const CAmount &nDebit, bool involvesWatchAddress, QList< TransactionRecord > &parts, const CWallet *wallet) |
| static bool | decomposeDebitTransaction (const CWallet *wallet, const CWalletTx &wtx, const CAmount &nDebit, bool involvesWatchAddress, QList< TransactionRecord > &parts) |
| Decompose wtx outputs in records. More... | |
| static bool | decomposeShieldedDebitTransaction (const CWallet *wallet, const CWalletTx &wtx, CAmount nTxFee, bool involvesWatchAddress, QList< TransactionRecord > &parts) |
| static std::string | getValueOrReturnEmpty (const std::map< std::string, std::string > &mapValue, const std::string &key) |
| static void | loadHotOrColdStakeOrContract (const CWallet *wallet, const CWalletTx &wtx, TransactionRecord &record, bool isContract=false) |
| static void | loadUnlockColdStake (const CWallet *wallet, const CWalletTx &wtx, TransactionRecord &record) |
Public Attributes | |
| int | idx |
| Subtransaction index, for sort key. More... | |
| TransactionStatus | status |
| Status: can change with block chain update. More... | |
| bool | involvesWatchAddress {false} |
| Whether the transaction was sent/received with a watch-only address. More... | |
Immutable transaction attributes | |
| uint256 | hash |
| qint64 | time |
| Type | type |
| std::string | address |
| CAmount | debit |
| CAmount | credit |
| unsigned int | size |
| Optional< CAmount > | shieldedCredit {nullopt} |
| Optional< std::string > | memo {nullopt} |
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 72 of file transactionrecord.h.
| enum TransactionRecord::Type : uint16_t |
Definition at line 75 of file transactionrecord.h.
|
inlineexplicit |
Definition at line 111 of file transactionrecord.h.
|
inline |
Definition at line 115 of file transactionrecord.h.
|
inline |
Definition at line 120 of file transactionrecord.h.
|
static |
Helpers.
Definition at line 23 of file transactionrecord.cpp.
|
static |
Decompose a credit transaction into a record for each received output.
Definition at line 139 of file transactionrecord.cpp.
|
static |
Decompose wtx outputs in records.
Definition at line 293 of file transactionrecord.cpp.
|
static |
Definition at line 114 of file transactionrecord.cpp.
|
static |
Definition at line 195 of file transactionrecord.cpp.
|
static |
|
static |
Decompose CWallet transaction to model transaction records.
Definition at line 404 of file transactionrecord.cpp.
|
static |
Definition at line 71 of file transactionrecord.cpp.
| int TransactionRecord::getOutputIndex | ( | ) | const |
Return the output index of the subtransaction
Definition at line 657 of file transactionrecord.cpp.
|
static |
| bool TransactionRecord::isAnyColdStakingType | ( | ) | const |
Return true if the tx is a any cold staking type tx.
Definition at line 672 of file transactionrecord.cpp.
| bool TransactionRecord::isCoinStake | ( | ) | const |
Return true if the tx is a coinstake.
Definition at line 662 of file transactionrecord.cpp.
| bool TransactionRecord::isMNReward | ( | ) | const |
Return true if the tx is a MN reward.
Definition at line 667 of file transactionrecord.cpp.
| bool TransactionRecord::isNull | ( | ) | const |
Return true if the tx hash is null and/or if the size is 0.
Definition at line 680 of file transactionrecord.cpp.
|
static |
Definition at line 537 of file transactionrecord.cpp.
|
static |
Definition at line 502 of file transactionrecord.cpp.
| std::string TransactionRecord::statusToString | ( | ) |
Return transaction status.
Definition at line 685 of file transactionrecord.cpp.
| bool TransactionRecord::statusUpdateNeeded | ( | int | blockHeight | ) | const |
Return whether a status update is needed.
Definition at line 652 of file transactionrecord.cpp.
| void TransactionRecord::updateStatus | ( | const CWalletTx & | wtx, |
| int | chainHeight | ||
| ) |
Update status from core wallet tx.
Definition at line 585 of file transactionrecord.cpp.
| std::string TransactionRecord::address |
Definition at line 166 of file transactionrecord.h.
| CAmount TransactionRecord::credit |
Definition at line 168 of file transactionrecord.h.
| CAmount TransactionRecord::debit |
Definition at line 167 of file transactionrecord.h.
| uint256 TransactionRecord::hash |
Definition at line 163 of file transactionrecord.h.
| int TransactionRecord::idx |
Subtransaction index, for sort key.
Definition at line 175 of file transactionrecord.h.
| bool TransactionRecord::involvesWatchAddress {false} |
Whether the transaction was sent/received with a watch-only address.
Definition at line 181 of file transactionrecord.h.
| Optional<std::string> TransactionRecord::memo {nullopt} |
Definition at line 171 of file transactionrecord.h.
|
static |
Number of confirmation recommended for accepting a transaction.
Definition at line 109 of file transactionrecord.h.
Definition at line 170 of file transactionrecord.h.
| unsigned int TransactionRecord::size |
Definition at line 169 of file transactionrecord.h.
| TransactionStatus TransactionRecord::status |
Status: can change with block chain update.
Definition at line 178 of file transactionrecord.h.
| qint64 TransactionRecord::time |
Definition at line 164 of file transactionrecord.h.
| Type TransactionRecord::type |
Definition at line 165 of file transactionrecord.h.