Raven Core  3.0.0
P2P Digital Currency
transactionrecord.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2016 The Bitcoin Core developers
2 // Copyright (c) 2017-2019 The Raven Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef RAVEN_QT_TRANSACTIONRECORD_H
7 #define RAVEN_QT_TRANSACTIONRECORD_H
8 
9 #include "amount.h"
10 #include "uint256.h"
11 
12 #include <QList>
13 #include <QString>
14 
15 class CWallet;
16 class CWalletTx;
17 
21 {
22 public:
24  countsForBalance(false), sortKey(""),
26  { }
27 
28  enum Status {
38  Immature,
42  };
43 
47  std::string sortKey;
48 
57  qint64 depth;
58  qint64 open_for;
65 
67 };
68 
73 {
74 public:
75  enum Type
76  {
87  TransferFrom
88  };
89 
91  static const int RecommendedNumConfirmations = 6;
92 
94  hash(), time(0), type(Other), address(""), debit(0), credit(0), assetName("RVN"), units(8), idx(0)
95  {
96  }
97 
98  TransactionRecord(uint256 _hash, qint64 _time):
99  hash(_hash), time(_time), type(Other), address(""), debit(0),
100  credit(0), assetName("RVN"), units(8), idx(0)
101  {
102  }
103 
104  TransactionRecord(uint256 _hash, qint64 _time,
105  Type _type, const std::string &_address,
106  const CAmount& _debit, const CAmount& _credit):
107  hash(_hash), time(_time), type(_type), address(_address), debit(_debit), credit(_credit),
108  assetName("RVN"), units(8), idx(0)
109  {
110  }
111 
114  static bool showTransaction(const CWalletTx &wtx);
115  static QList<TransactionRecord> decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx);
116 
120  qint64 time;
122  std::string address;
125  std::string assetName;
126  uint8_t units;
130  int idx;
131 
134 
137 
139  QString getTxID() const;
140 
142  int getOutputIndex() const;
143 
146  void updateStatus(const CWalletTx &wtx);
147 
150  bool statusUpdateNeeded() const;
151 };
152 
153 #endif // RAVEN_QT_TRANSACTIONRECORD_H
Confirmed, but waiting for the recommended number of confirmations.
Transaction not yet final, waiting for block.
int idx
Subtransaction index, for sort key.
Not sent to any other nodes.
Generated (mined) transactions.
Have 6 or more confirmations (normal tx) or fully mature (mined tx)
std::string sortKey
Sorting key based on status.
TransactionRecord(uint256 _hash, qint64 _time)
Mined but not accepted.
Not yet mined into a block.
UI model for transaction status.
int64_t CAmount
Amount in corbies (Can be negative)
Definition: amount.h:13
UI model for a transaction.
TransactionStatus status
Status: can change with block chain update.
bool countsForBalance
Transaction counts towards available balance.
int cur_num_blocks
Current number of blocks (to know whether cached status is still valid)
Normal (sent/received) transactions.
A transaction with a bunch of additional info that only the owner cares about.
Definition: wallet.h:285
256-bit opaque blob.
Definition: uint256.h:123
Conflicts with other transaction or mempool.
TransactionRecord(uint256 _hash, qint64 _time, Type _type, const std::string &_address, const CAmount &_debit, const CAmount &_credit)
bool involvesWatchAddress
Whether the transaction was sent/received with a watch-only address.
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
Definition: wallet.h:673
qint64 open_for
Timestamp if status==OpenUntilDate, otherwise number of additional blocks that need to be mined befor...
Abandoned from the wallet.
Transaction will likely not mature because no nodes have confirmed.