Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

transactionrecord.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2014 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 #include <base58.h>
11 
12 #include <QList>
13 #include <QString>
14 
15 class CWallet;
16 class CWalletTx;
17 
21 {
22 public:
27  { }
28 
29  enum Status {
38  Immature,
41  };
42 
50  std::string sortKey;
52  QString label;
53 
62  qint64 depth;
63  qint64 open_for;
70 
71  //** Know when to update transaction for chainlocks **/
73 
75 };
76 
81 {
82 public:
83  enum Type
84  {
98  };
99 
101  static const int RecommendedNumConfirmations = 6;
102 
104  hash(), time(0), type(Other), strAddress(""), debit(0), credit(0), idx(0)
105  {
107  }
108 
109  TransactionRecord(uint256 _hash, qint64 _time):
110  hash(_hash), time(_time), type(Other), strAddress(""), debit(0),
111  credit(0), idx(0)
112  {
114  }
115 
116  TransactionRecord(uint256 _hash, qint64 _time,
117  Type _type, const std::string &_strAddress,
118  const CAmount& _debit, const CAmount& _credit):
119  hash(_hash), time(_time), type(_type), strAddress(_strAddress), debit(_debit), credit(_credit),
120  idx(0)
121  {
123  }
124 
127  static bool showTransaction(const CWalletTx &wtx);
128  static QList<TransactionRecord> decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx);
129 
133  qint64 time;
135  std::string strAddress;
137 
143  int idx;
144 
147 
150 
152  QString getTxID() const;
153 
155  int getOutputIndex() const;
156 
159  void updateStatus(const CWalletTx &wtx, int chainLockHeight);
160 
163  bool statusUpdateNeeded(int chainLockHeight) const;
164 };
165 
166 #endif // BITCOIN_QT_TRANSACTIONRECORD_H
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
Definition: standard.h:80
Confirmed, but waiting for the recommended number of confirmations.
Transaction not yet final, waiting for block.
int idx
Subtransaction index, for sort key.
Generated (mined) transactions.
Have 6 or more confirmations (normal tx) or fully mature (mined tx)
std::string sortKey
Sorting key based on status.
CTxDestination DecodeDestination(const std::string &str)
Definition: base58.cpp:336
TransactionRecord(uint256 _hash, qint64 _time)
QString label
Label.
Mined but not accepted.
Not yet mined into a block.
void updateStatus(const CWalletTx &wtx, int chainLockHeight)
Update status from core wallet tx.
TransactionRecord(uint256 _hash, qint64 _time, Type _type, const std::string &_strAddress, const CAmount &_debit, const CAmount &_credit)
static bool showTransaction(const CWalletTx &wtx)
Decompose CWallet transaction to model transaction records.
bool lockedByChainLocks
Transaction was locked via ChainLocks.
UI model for transaction status.
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
false
Definition: bls_dkg.cpp:168
int getOutputIndex() const
Return the output index of the subtransaction.
CTxDestination txDest
UI model for a transaction.
TransactionStatus status
Status: can change with block chain update.
static QList< TransactionRecord > decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx)
QString getTxID() const
Return the unique identifier for this transaction (part)
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:280
256-bit opaque blob.
Definition: uint256.h:123
Conflicts with other transaction or mempool.
bool lockedByInstantSend
Transaction was locked via InstantSend.
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:715
bool statusUpdateNeeded(int chainLockHeight) const
Return whether a status update is needed.
qint64 open_for
Timestamp if status==OpenUntilDate, otherwise number of additional blocks that need to be mined befor...
Abandoned from the wallet.
static const int RecommendedNumConfirmations
Number of confirmation recommended for accepting a transaction.
Released under the MIT license