Feathercoin  0.5.0
P2P Digital Currency
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
transactionrecord.h
Go to the documentation of this file.
1 #ifndef TRANSACTIONRECORD_H
2 #define TRANSACTIONRECORD_H
3 
4 #include "uint256.h"
5 
6 #include <QList>
7 
8 class CWallet;
9 class CWalletTx;
10 
14 {
15 public:
17  confirmed(false), sortKey(""), maturity(Mature),
19  { }
20 
21  enum Maturity
22  {
27  };
28 
29  enum Status {
35  };
36 
37  bool confirmed;
38  std::string sortKey;
39 
57 };
58 
63 {
64 public:
65  enum Type
66  {
74  };
75 
77  static const int NumConfirmations = 6;
78 
80  hash(), time(0), type(Other), address(""), debit(0), credit(0), idx(0)
81  {
82  }
83 
85  hash(hash), time(time), type(Other), address(""), debit(0),
86  credit(0), idx(0)
87  {
88  }
89 
91  Type type, const std::string &address,
93  hash(hash), time(time), type(type), address(address), debit(debit), credit(credit),
94  idx(0)
95  {
96  }
97 
100  static bool showTransaction(const CWalletTx &wtx);
101  static QList<TransactionRecord> decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx);
102 
108  std::string address;
114  int idx;
115 
118 
120  std::string getTxID();
121 
124  void updateStatus(const CWalletTx &wtx);
125 
128  bool statusUpdateNeeded();
129 };
130 
131 #endif // TRANSACTIONRECORD_H
TransactionRecord(uint256 hash, int64 time, Type type, const std::string &address, int64 debit, int64 credit)
int idx
Subtransaction index, for sort key.
std::string getTxID()
Return the unique identifier for this transaction (part)
static bool showTransaction(const CWalletTx &wtx)
Decompose CWallet transaction to model transaction records.
UI model for transaction status.
TransactionRecord(uint256 hash, int64 time)
UI model for a transaction.
TransactionStatus status
Status: can change with block chain update.
static QList< TransactionRecord > decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx)
void updateStatus(const CWalletTx &wtx)
Update status from core wallet tx.
static const int NumConfirmations
Number of confirmation needed for transaction.
int cur_num_blocks
Current number of blocks (to know whether cached status is still valid)
A transaction with a bunch of additional info that only the owner cares about.
Definition: wallet.h:367
Transaction will likely not mature because no nodes have confirmed.
int64 open_for
Timestamp if status==OpenUntilDate, otherwise number of additional blocks that need to be mined befor...
256-bit unsigned integer
Definition: uint256.h:537
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
Definition: wallet.h:69
bool statusUpdateNeeded()
Return whether a status update is needed.
long long int64
Definition: serialize.h:25