2014-01-05 20:03:23 +00:00
|
|
|
// Copyright (c) 2011-2014 The Bitcoin Core developers
|
2014-12-13 04:09:33 +00:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
2013-11-04 15:20:43 +00:00
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2014-11-03 15:16:40 +00:00
|
|
|
#ifndef BITCOIN_QT_WALLETMODELTRANSACTION_H
|
|
|
|
#define BITCOIN_QT_WALLETMODELTRANSACTION_H
|
2013-08-30 18:04:48 +00:00
|
|
|
|
|
|
|
#include "walletmodel.h"
|
|
|
|
|
2013-04-13 05:13:08 +00:00
|
|
|
#include <QObject>
|
|
|
|
|
2013-08-30 18:04:48 +00:00
|
|
|
class SendCoinsRecipient;
|
|
|
|
|
2013-04-13 05:13:08 +00:00
|
|
|
class CReserveKey;
|
|
|
|
class CWallet;
|
|
|
|
class CWalletTx;
|
|
|
|
|
2013-08-30 18:04:48 +00:00
|
|
|
/** Data model for a walletmodel transaction. */
|
|
|
|
class WalletModelTransaction
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit WalletModelTransaction(const QList<SendCoinsRecipient> &recipients);
|
|
|
|
~WalletModelTransaction();
|
|
|
|
|
|
|
|
QList<SendCoinsRecipient> getRecipients();
|
|
|
|
|
|
|
|
CWalletTx *getTransaction();
|
2014-11-01 23:14:47 +00:00
|
|
|
unsigned int getTransactionSize();
|
2013-08-30 18:04:48 +00:00
|
|
|
|
2014-04-22 22:46:19 +00:00
|
|
|
void setTransactionFee(const CAmount& newFee);
|
|
|
|
CAmount getTransactionFee();
|
2013-08-30 18:04:48 +00:00
|
|
|
|
2014-04-22 22:46:19 +00:00
|
|
|
CAmount getTotalTransactionAmount();
|
2013-08-30 18:04:48 +00:00
|
|
|
|
|
|
|
void newPossibleKeyChange(CWallet *wallet);
|
|
|
|
CReserveKey *getPossibleKeyChange();
|
|
|
|
|
2014-07-23 12:34:36 +00:00
|
|
|
void reassignAmounts(int nChangePosRet); // needed for the subtract-fee-from-amount feature
|
|
|
|
|
2013-08-30 18:04:48 +00:00
|
|
|
private:
|
2014-07-23 12:34:36 +00:00
|
|
|
QList<SendCoinsRecipient> recipients;
|
2013-08-30 18:04:48 +00:00
|
|
|
CWalletTx *walletTransaction;
|
|
|
|
CReserveKey *keyChange;
|
2014-04-22 22:46:19 +00:00
|
|
|
CAmount fee;
|
2013-08-30 18:04:48 +00:00
|
|
|
};
|
|
|
|
|
2014-11-03 15:16:40 +00:00
|
|
|
#endif // BITCOIN_QT_WALLETMODELTRANSACTION_H
|