Fabcoin Core  0.16.2
P2P Digital Currency
transactionrecord.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2017 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 FABCOIN_QT_TRANSACTIONRECORD_H
6 #define FABCOIN_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 
66 };
67 
72 {
73 public:
74  enum Type
75  {
84  ContractSend
85  };
86 
88  static const int RecommendedNumConfirmations = 10;
89 
91  hash(), time(0), type(Other), address(""), debit(0), credit(0), idx(0)
92  {
93  }
94 
95  TransactionRecord(uint256 _hash, qint64 _time):
96  hash(_hash), time(_time), type(Other), address(""), debit(0),
97  credit(0), idx(0)
98  {
99  }
100 
101  TransactionRecord(uint256 _hash, qint64 _time,
102  Type _type, const std::string &_address,
103  const CAmount& _debit, const CAmount& _credit):
104  hash(_hash), time(_time), type(_type), address(_address), debit(_debit), credit(_credit),
105  idx(0)
106  {
107  }
108 
111  static bool showTransaction(const CWalletTx &wtx);
112  static QList<TransactionRecord> decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx);
113 
117  qint64 time;
119  std::string address;
125  int idx;
126 
129 
132 
134  QString getTxID() const;
135 
137  int getOutputIndex() const;
138 
141  void updateStatus(const CWalletTx &wtx);
142 
145  bool statusUpdateNeeded();
146 };
147 
148 #endif // FABCOIN_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 lius (Can be negative)
Definition: amount.h:15
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:287
256-bit opaque blob.
Definition: uint256.h:132
PlatformStyle::TableColorType type
Definition: rpcconsole.cpp:61
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:672
struct evm_uint160be address(struct evm_env *env)
Definition: capi.c:13
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.