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