2019-12-30 22:39:22 +13:00
|
|
|
// Copyright (c) 2011-2019 The Bitcoin Core developers
|
2014-12-13 12:09:33 +08: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
|
|
|
|
2019-11-19 11:56:42 +02:00
|
|
|
#include <primitives/transaction.h>
|
2019-11-19 11:10:40 +02:00
|
|
|
#include <qt/sendcoinsrecipient.h>
|
2013-08-30 20:04:48 +02:00
|
|
|
|
2017-11-06 19:12:47 +01:00
|
|
|
#include <amount.h>
|
2018-04-02 18:31:40 +00:00
|
|
|
|
2013-04-13 00:13:08 -05:00
|
|
|
#include <QObject>
|
|
|
|
|
2013-08-30 20:04:48 +02:00
|
|
|
class SendCoinsRecipient;
|
|
|
|
|
2018-04-07 03:42:02 -04:00
|
|
|
namespace interfaces {
|
2017-04-17 18:56:44 -04:00
|
|
|
class Node;
|
|
|
|
}
|
2013-04-13 00:13:08 -05: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
|
|
|
|
2019-07-18 12:06:23 -04:00
|
|
|
CTransactionRef& getWtx();
|
2014-11-02 00:14:47 +01:00
|
|
|
unsigned int getTransactionSize();
|
2013-08-30 20:04:48 +02:00
|
|
|
|
2014-04-22 15:46:19 -07: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;
|
2019-07-18 12:06:23 -04:00
|
|
|
CTransactionRef wtx;
|
2014-04-22 15:46:19 -07:00
|
|
|
CAmount fee;
|
2013-08-30 20:04:48 +02:00
|
|
|
};
|
|
|
|
|
2014-11-03 16:16:40 +01:00
|
|
|
#endif // BITCOIN_QT_WALLETMODELTRANSACTION_H
|