1 #ifndef TRANSACTIONRECORD_H
2 #define TRANSACTIONRECORD_H
11 class TransactionStatus
15 confirmed(false), sortKey(""), maturity(Mature),
16 matures_in(0), status(Offline), depth(0), open_for(0), cur_num_blocks(-1)
23 MaturesWarning, /* Will likely not mature because no nodes have confirmed */
38 /* For "Generated" transactions */
45 int64 open_for; /* Timestamp if status==OpenUntilDate, otherwise number of blocks */
47 /* Current number of blocks (to know whether cached status is still valid. */
51 class TransactionRecord
65 /* Number of confirmation needed for transaction */
66 static const int NumConfirmations = 6;
69 hash(), time(0), type(Other), address(""), debit(0), credit(0), idx(0)
73 TransactionRecord(uint256 hash, int64 time):
74 hash(hash), time(time), type(Other), address(""), debit(0),
79 TransactionRecord(uint256 hash, int64 time,
80 Type type, const std::string &address,
81 int64 debit, int64 credit):
82 hash(hash), time(time), type(type), address(address), debit(debit), credit(credit),
87 /* Decompose CWallet transaction to model transaction records.
89 static bool showTransaction(const CWalletTx &wtx);
90 static QList<TransactionRecord> decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx);
100 /* Subtransaction index, for sort key */
103 /* Status: can change with block chain update */
104 TransactionStatus status;
106 /* Return the unique identifier for this transaction (part) */
107 std::string getTxID();
109 /* Update status from wallet tx.
111 void updateStatus(const CWalletTx &wtx);
113 /* Is a status update needed?
115 bool statusUpdateNeeded();
118 #endif // TRANSACTIONRECORD_H