Dash Core  0.12.2.1
P2P Digital Currency
transactionrecord.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2013 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_QT_TRANSACTIONRECORD_H
6 #define BITCOIN_QT_TRANSACTIONRECORD_H
7 
8 #include "amount.h"
9 #include "uint256.h"
10 
11 #include <QList>
12 #include <QString>
13 
14 class CWallet;
15 class CWalletTx;
16 
20 {
21 public:
23  countsForBalance(false), sortKey(""),
25  { }
26 
27  enum Status {
37  Immature,
41  };
42 
46  std::string sortKey;
47 
56  qint64 depth;
57  qint64 open_for;
64 
65  //** Know when to update transaction for ix locks **/
67 };
68 
73 {
74 public:
75  enum Type
76  {
90  };
91 
93  static const int RecommendedNumConfirmations = 6;
94 
96  hash(), time(0), type(Other), address(""), debit(0), credit(0), idx(0)
97  {
98  }
99 
101  hash(hash), time(time), type(Other), address(""), debit(0),
102  credit(0), idx(0)
103  {
104  }
105 
107  Type type, const std::string &address,
108  const CAmount& debit, const CAmount& credit):
110  idx(0)
111  {
112  }
113 
116  static bool showTransaction(const CWalletTx &wtx);
117  static QList<TransactionRecord> decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx);
118 
122  qint64 time;
124  std::string address;
130  int idx;
131 
134 
137 
139  QString getTxID() const;
140 
142  static QString formatSubTxId(const uint256 &hash, int vout);
143 
146  void updateStatus(const CWalletTx &wtx);
147 
150  bool statusUpdateNeeded();
151 };
152 
153 #endif // BITCOIN_QT_TRANSACTIONRECORD_H
void updateStatus(const CWalletTx &wtx)
Normal (sent/received) transactions.
static bool showTransaction(const CWalletTx &wtx)
std::string sortKey
Sorting key based on status.
TransactionStatus status
int64_t CAmount
Definition: amount.h:14
TransactionRecord(uint256 hash, qint64 time)
static QList< TransactionRecord > decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx)
static const int RecommendedNumConfirmations
Definition: wallet.py:1
TransactionRecord(uint256 hash, qint64 time, Type type, const std::string &address, const CAmount &debit, const CAmount &credit)
Generated (mined) transactions.
QString getTxID() const
static QString formatSubTxId(const uint256 &hash, int vout)
bool countsForBalance
Transaction counts towards available balance.