2018-01-02 09:12:05 -08:00
|
|
|
// Copyright (c) 2011-2017 The Bitcoin Core developers
|
2014-12-12 20:09:33 -08:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
2013-11-04 07:20:43 -08:00
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2014-11-03 07:16:40 -08:00
|
|
|
#ifndef BITCOIN_QT_WALLETMODELTRANSACTION_H
|
|
|
|
#define BITCOIN_QT_WALLETMODELTRANSACTION_H
|
2013-08-30 11:04:48 -07:00
|
|
|
|
2017-11-09 16:57:53 -08:00
|
|
|
#include <qt/walletmodel.h>
|
2013-08-30 11:04:48 -07:00
|
|
|
|
2018-04-02 11:31:40 -07:00
|
|
|
#include <memory>
|
|
|
|
|
2013-04-12 22:13:08 -07:00
|
|
|
#include <QObject>
|
|
|
|
|
2013-08-30 11:04:48 -07:00
|
|
|
class SendCoinsRecipient;
|
|
|
|
|
2017-04-17 15:56:44 -07:00
|
|
|
namespace interface {
|
|
|
|
class Node;
|
|
|
|
class PendingWalletTx;
|
|
|
|
}
|
2013-04-12 22:13:08 -07:00
|
|
|
|
2013-08-30 11:04:48 -07:00
|
|
|
/** Data model for a walletmodel transaction. */
|
|
|
|
class WalletModelTransaction
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit WalletModelTransaction(const QList<SendCoinsRecipient> &recipients);
|
|
|
|
|
2017-03-09 04:34:54 -08:00
|
|
|
QList<SendCoinsRecipient> getRecipients() const;
|
2013-08-30 11:04:48 -07:00
|
|
|
|
2017-04-17 15:56:44 -07:00
|
|
|
std::unique_ptr<interface::PendingWalletTx>& getWtx();
|
2014-11-01 16:14:47 -07:00
|
|
|
unsigned int getTransactionSize();
|
2013-08-30 11:04:48 -07:00
|
|
|
|
2014-04-22 15:46:19 -07:00
|
|
|
void setTransactionFee(const CAmount& newFee);
|
2017-03-09 04:34:54 -08:00
|
|
|
CAmount getTransactionFee() const;
|
2013-08-30 11:04:48 -07:00
|
|
|
|
2017-03-09 04:34:54 -08:00
|
|
|
CAmount getTotalTransactionAmount() const;
|
2013-08-30 11:04:48 -07:00
|
|
|
|
2014-07-23 05:34:36 -07:00
|
|
|
void reassignAmounts(int nChangePosRet); // needed for the subtract-fee-from-amount feature
|
|
|
|
|
2013-08-30 11:04:48 -07:00
|
|
|
private:
|
2014-07-23 05:34:36 -07:00
|
|
|
QList<SendCoinsRecipient> recipients;
|
2017-04-17 15:56:44 -07:00
|
|
|
std::unique_ptr<interface::PendingWalletTx> wtx;
|
2014-04-22 15:46:19 -07:00
|
|
|
CAmount fee;
|
2013-08-30 11:04:48 -07:00
|
|
|
};
|
|
|
|
|
2014-11-03 07:16:40 -08:00
|
|
|
#endif // BITCOIN_QT_WALLETMODELTRANSACTION_H
|