1 #ifndef TRANSACTIONRECORD_H
2 #define TRANSACTIONRECORD_H
10 class TransactionStatus
14 confirmed(false), sortKey(""), maturity(Mature),
15 matures_in(0), status(Offline), depth(0), open_for(0), cur_num_blocks(-1)
22 MaturesWarning, /* Will likely not mature because no nodes have confirmed */
37 /* For "Generated" transactions */
44 int64 open_for; /* Timestamp if status==OpenUntilDate, otherwise number of blocks */
46 /* Current number of blocks (to know whether cached status is still valid. */
50 class TransactionRecord
64 /* Number of confirmation needed for transaction */
65 static const int NumConfirmations = 6;
68 hash(), time(0), type(Other), address(""), debit(0), credit(0), idx(0)
72 TransactionRecord(uint256 hash, int64 time):
73 hash(hash), time(time), type(Other), address(""), debit(0),
78 TransactionRecord(uint256 hash, int64 time,
79 Type type, const std::string &address,
80 int64 debit, int64 credit):
81 hash(hash), time(time), type(type), address(address), debit(debit), credit(credit),
86 /* Decompose CWallet transaction to model transaction records.
88 static bool showTransaction(const CWalletTx &wtx);
89 static QList<TransactionRecord> decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx);
99 /* Subtransaction index, for sort key */
102 /* Status: can change with block chain update */
103 TransactionStatus status;
105 /* Update status from wallet tx.
107 void updateStatus(const CWalletTx &wtx);
109 /* Is a status update needed?
111 bool statusUpdateNeeded();
114 #endif // TRANSACTIONRECORD_H