7 #ifndef PIVX_QT_TRANSACTIONRECORD_H
8 #define PIVX_QT_TRANSACTIONRECORD_H
120 TransactionRecord(
uint256 hash, qint64
time,
unsigned int size,
Type type,
const std::string&
address,
const CAmount&
debit,
const CAmount&
credit) :
hash(
hash),
time(
time),
type(
type),
address(
address),
debit(
debit),
credit(
credit),
132 QList<TransactionRecord>& parts);
136 QList<TransactionRecord>& parts);
140 QList<TransactionRecord>& parts);
143 QList<TransactionRecord>& parts);
147 QList<TransactionRecord>& parts,
const CWallet* wallet);
151 QList<TransactionRecord>& parts);
156 static std::string
getValueOrReturnEmpty(
const std::map<std::string, std::string>& mapValue,
const std::string& key);
int64_t CAmount
Amount in PIV (Can be negative)
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances,...
A transaction with a bunch of additional info that only the owner cares about.
UI model for a transaction.
TransactionRecord(unsigned int size)
bool isMNReward() const
Return true if the tx is a MN reward.
static bool decomposeShieldedDebitTransaction(const CWallet *wallet, const CWalletTx &wtx, CAmount nTxFee, bool involvesWatchAddress, QList< TransactionRecord > &parts)
std::string statusToString()
Return transaction status.
TransactionRecord(uint256 hash, qint64 time, unsigned int size, Type type, const std::string &address, const CAmount &debit, const CAmount &credit)
static std::string getValueOrReturnEmpty(const std::map< std::string, std::string > &mapValue, const std::string &key)
int idx
Subtransaction index, for sort key.
static void loadHotOrColdStakeOrContract(const CWallet *wallet, const CWalletTx &wtx, TransactionRecord &record, bool isContract=false)
@ RecvWithShieldedAddress
@ SendToSelfShieldToTransparent
@ ZerocoinSpend_Change_zPiv
@ P2CSDelegationSentOwner
@ SendToSelfShieldedAddress
@ RecvWithShieldedAddressMemo
@ SendToSelfShieldToShieldChangeAddress
static const int RecommendedNumConfirmations
Number of confirmation recommended for accepting a transaction.
Optional< CAmount > shieldedCredit
bool isCoinStake() const
Return true if the tx is a coinstake.
static void loadUnlockColdStake(const CWallet *wallet, const CWalletTx &wtx, TransactionRecord &record)
TransactionStatus status
Status: can change with block chain update.
void updateStatus(const CWalletTx &wtx, int chainHeight)
Update status from core wallet tx.
int getOutputIndex() const
Return the output index of the subtransaction
static bool decomposeCoinStake(const CWallet *wallet, const CWalletTx &wtx, const CAmount &nCredit, const CAmount &nDebit, QList< TransactionRecord > &parts)
Helpers.
static bool decomposeZcSpendTx(const CWallet *wallet, const CWalletTx &wtx, const CAmount &nCredit, const CAmount &nDebit, QList< TransactionRecord > &parts)
bool isAnyColdStakingType() const
Return true if the tx is a any cold staking type tx.
static bool decomposeCreditTransaction(const CWallet *wallet, const CWalletTx &wtx, QList< TransactionRecord > &parts)
Decompose a credit transaction into a record for each received output.
static bool decomposeDebitTransaction(const CWallet *wallet, const CWalletTx &wtx, const CAmount &nDebit, bool involvesWatchAddress, QList< TransactionRecord > &parts)
Decompose wtx outputs in records.
TransactionRecord(uint256 hash, qint64 time, unsigned int size)
bool isNull() const
Return true if the tx hash is null and/or if the size is 0.
static QList< TransactionRecord > decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx)
Decompose CWallet transaction to model transaction records.
Optional< std::string > memo
bool statusUpdateNeeded(int blockHeight) const
Return whether a status update is needed.
static bool decomposeP2CS(const CWallet *wallet, const CWalletTx &wtx, const CAmount &nCredit, const CAmount &nDebit, QList< TransactionRecord > &parts)
bool involvesWatchAddress
Whether the transaction was sent/received with a watch-only address.
static bool decomposeSendToSelfTransaction(const CWalletTx &wtx, const CAmount &nCredit, const CAmount &nDebit, bool involvesWatchAddress, QList< TransactionRecord > &parts, const CWallet *wallet)
UI model for transaction status.
bool countsForBalance
Transaction counts towards available balance.
int cur_num_blocks
Current number of blocks (to know whether cached status is still valid)
@ Confirmed
Have 6 or more confirmations (normal tx) or fully mature (mined tx)
@ OpenUntilDate
Normal (sent/received) transactions.
@ Unconfirmed
Not yet mined into a block.
@ Immature
Generated (mined) transactions.
@ Confirming
Confirmed, but waiting for the recommended number of confirmations.
@ NotAccepted
Mined but not accepted.
@ OpenUntilBlock
Transaction not yet final, waiting for block.
@ Conflicted
Conflicts with other transaction or mempool.
qint64 open_for
Timestamp if status==OpenUntilDate, otherwise number of additional blocks that need to be mined befor...
std::string sortKey
Sorting key based on status.
boost::optional< T > Optional
Substitute for C++17 std::optional.