2017-11-09 19:34:51 +01:00
|
|
|
/*
|
|
|
|
|
* This file is part of the Flowee project
|
|
|
|
|
* Copyright (C) 2011-2013 The Bitcoin Core developers
|
|
|
|
|
*
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
2013-11-04 16:20:43 +01:00
|
|
|
|
2018-01-16 10:47:52 +00:00
|
|
|
#ifndef FLOWEE_QT_WALLETMODELTRANSACTION_H
|
|
|
|
|
#define FLOWEE_QT_WALLETMODELTRANSACTION_H
|
2013-08-30 20:04:48 +02:00
|
|
|
|
|
|
|
|
#include "walletmodel.h"
|
|
|
|
|
|
2013-04-13 00:13:08 -05:00
|
|
|
#include <QObject>
|
|
|
|
|
|
2013-08-30 20:04:48 +02:00
|
|
|
class SendCoinsRecipient;
|
|
|
|
|
|
2013-04-13 00:13:08 -05:00
|
|
|
class CReserveKey;
|
|
|
|
|
class CWallet;
|
|
|
|
|
class CWalletTx;
|
|
|
|
|
|
2013-08-30 20:04:48 +02:00
|
|
|
/** Data model for a walletmodel transaction. */
|
|
|
|
|
class WalletModelTransaction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit WalletModelTransaction(const QList<SendCoinsRecipient> &recipients);
|
|
|
|
|
~WalletModelTransaction();
|
|
|
|
|
|
|
|
|
|
QList<SendCoinsRecipient> getRecipients();
|
|
|
|
|
|
|
|
|
|
CWalletTx *getTransaction();
|
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);
|
|
|
|
|
CAmount getTransactionFee();
|
2013-08-30 20:04:48 +02:00
|
|
|
|
2014-04-22 15:46:19 -07:00
|
|
|
CAmount getTotalTransactionAmount();
|
2013-08-30 20:04:48 +02:00
|
|
|
|
|
|
|
|
void newPossibleKeyChange(CWallet *wallet);
|
|
|
|
|
CReserveKey *getPossibleKeyChange();
|
|
|
|
|
|
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;
|
2013-08-30 20:04:48 +02:00
|
|
|
CWalletTx *walletTransaction;
|
|
|
|
|
CReserveKey *keyChange;
|
2014-04-22 15:46:19 -07:00
|
|
|
CAmount fee;
|
2013-08-30 20:04:48 +02:00
|
|
|
};
|
|
|
|
|
|
2018-01-16 10:47:52 +00:00
|
|
|
#endif
|