1 #ifndef TRANSACTIONRECORD_H
2 #define TRANSACTIONRECORD_H
11 /** UI model for transaction status. The transaction status is the part of a transaction that will change over time.
13 class TransactionStatus
17 confirmed(false), sortKey(""), maturity(Mature),
18 matures_in(0), status(Offline), depth(0), open_for(0), cur_num_blocks(-1)
25 MaturesWarning, /**< Transaction will likely not mature because no nodes have confirmed */
40 /** @name Generated (mined) transactions
46 /** @name Reported status
50 int64 open_for; /**< Timestamp if status==OpenUntilDate, otherwise number of blocks */
53 /** Current number of blocks (to know whether cached status is still valid) */
57 /** UI model for a transaction. A core transaction can be represented by multiple UI transactions if it has
60 class TransactionRecord
74 /** Number of confirmation needed for transaction */
75 static const int NumConfirmations = 6;
78 hash(), time(0), type(Other), address(""), debit(0), credit(0), idx(0)
82 TransactionRecord(uint256 hash, int64 time):
83 hash(hash), time(time), type(Other), address(""), debit(0),
88 TransactionRecord(uint256 hash, int64 time,
89 Type type, const std::string &address,
90 int64 debit, int64 credit):
91 hash(hash), time(time), type(type), address(address), debit(debit), credit(credit),
96 /** Decompose CWallet transaction to model transaction records.
98 static bool showTransaction(const CWalletTx &wtx);
99 static QList<TransactionRecord> decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx);
101 /** @name Immutable transaction attributes
111 /** Subtransaction index, for sort key */
114 /** Status: can change with block chain update */
115 TransactionStatus status;
117 /** Return the unique identifier for this transaction (part) */
118 std::string getTxID();
120 /** Update status from core wallet tx.
122 void updateStatus(const CWalletTx &wtx);
124 /** Return whether a status update is needed.
126 bool statusUpdateNeeded();
129 #endif // TRANSACTIONRECORD_H