Changeset View
Changeset View
Standalone View
Standalone View
src/qt/walletmodeltransaction.h
// Copyright (c) 2011-2014 The Bitcoin Core developers | // Copyright (c) 2011-2014 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_QT_WALLETMODELTRANSACTION_H | #ifndef BITCOIN_QT_WALLETMODELTRANSACTION_H | ||||
#define BITCOIN_QT_WALLETMODELTRANSACTION_H | #define BITCOIN_QT_WALLETMODELTRANSACTION_H | ||||
#include "walletmodel.h" | #include <qt/walletmodel.h> | ||||
#include <QObject> | #include <QObject> | ||||
class SendCoinsRecipient; | class SendCoinsRecipient; | ||||
class CReserveKey; | namespace interfaces { | ||||
class CWallet; | class Node; | ||||
class CWalletTx; | class PendingWalletTx; | ||||
} | |||||
/** Data model for a walletmodel transaction. */ | /** Data model for a walletmodel transaction. */ | ||||
class WalletModelTransaction { | class WalletModelTransaction { | ||||
public: | public: | ||||
explicit WalletModelTransaction( | explicit WalletModelTransaction( | ||||
const QList<SendCoinsRecipient> &recipients); | const QList<SendCoinsRecipient> &recipients); | ||||
QList<SendCoinsRecipient> getRecipients() const; | QList<SendCoinsRecipient> getRecipients() const; | ||||
CTransactionRef &getTransaction(); | std::unique_ptr<interfaces::PendingWalletTx> &getWtx(); | ||||
unsigned int getTransactionSize(); | unsigned int getTransactionSize(); | ||||
void setTransactionFee(const Amount newFee); | void setTransactionFee(const Amount newFee); | ||||
Amount getTransactionFee() const; | Amount getTransactionFee() const; | ||||
Amount getTotalTransactionAmount() const; | Amount getTotalTransactionAmount() const; | ||||
void newPossibleKeyChange(CWallet *wallet); | |||||
CReserveKey *getPossibleKeyChange(); | |||||
// needed for the subtract-fee-from-amount feature | // needed for the subtract-fee-from-amount feature | ||||
void reassignAmounts(int nChangePosRet); | void reassignAmounts(int nChangePosRet); | ||||
private: | private: | ||||
QList<SendCoinsRecipient> recipients; | QList<SendCoinsRecipient> recipients; | ||||
CTransactionRef walletTransaction; | std::unique_ptr<interfaces::PendingWalletTx> wtx; | ||||
std::unique_ptr<CReserveKey> keyChange; | |||||
Amount fee; | Amount fee; | ||||
}; | }; | ||||
#endif // BITCOIN_QT_WALLETMODELTRANSACTION_H | #endif // BITCOIN_QT_WALLETMODELTRANSACTION_H |