Anoncoin  0.9.4
P2P Digital Currency
walletmodeltransaction.cpp
Go to the documentation of this file.
1 // Copyright (c) 2011-2013 The Bitcoin developers
2 // Copyright (c) 2013-2014 The Anoncoin Core developers
3 // Distributed under the MIT/X11 software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
7 
8 #include "wallet.h"
9 
10 WalletModelTransaction::WalletModelTransaction(const QList<SendCoinsRecipient> &recipients) :
11  recipients(recipients),
12  walletTransaction(0),
13  keyChange(0),
14  fee(0)
15 {
17 }
18 
20 {
21  delete keyChange;
22  delete walletTransaction;
23 }
24 
25 QList<SendCoinsRecipient> WalletModelTransaction::getRecipients()
26 {
27  return recipients;
28 }
29 
31 {
32  return walletTransaction;
33 }
34 
36 {
37  return fee;
38 }
39 
41 {
42  fee = newFee;
43 }
44 
46 {
47  qint64 totalTransactionAmount = 0;
48  foreach(const SendCoinsRecipient &rcp, recipients)
49  {
50  totalTransactionAmount += rcp.amount;
51  }
52  return totalTransactionAmount;
53 }
54 
56 {
57  keyChange = new CReserveKey(wallet);
58 }
59 
61 {
62  return keyChange;
63 }
void newPossibleKeyChange(CWallet *wallet)
void setTransactionFee(qint64 newFee)
WalletModelTransaction(const QList< SendCoinsRecipient > &recipients)
QList< SendCoinsRecipient > getRecipients()
A transaction with a bunch of additional info that only the owner cares about.
Definition: wallet.h:464
A key allocated from the key pool.
Definition: wallet.h:415
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
Definition: wallet.h:101
const QList< SendCoinsRecipient > recipients