From a0704a8996bb950ae3c4d5b5a30e9dfe34cde1d3 Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Mon, 17 Apr 2017 18:56:44 -0400 Subject: Remove most direct bitcoin calls from qt/walletmodel.cpp --- src/qt/walletmodeltransaction.cpp | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'src/qt/walletmodeltransaction.cpp') diff --git a/src/qt/walletmodeltransaction.cpp b/src/qt/walletmodeltransaction.cpp index 4df8a5687e..21bdfe3818 100644 --- a/src/qt/walletmodeltransaction.cpp +++ b/src/qt/walletmodeltransaction.cpp @@ -4,12 +4,11 @@ #include +#include #include -#include WalletModelTransaction::WalletModelTransaction(const QList &_recipients) : recipients(_recipients), - walletTransaction(0), fee(0) { } @@ -19,14 +18,14 @@ QList WalletModelTransaction::getRecipients() const return recipients; } -CTransactionRef& WalletModelTransaction::getTransaction() +std::unique_ptr& WalletModelTransaction::getWtx() { - return walletTransaction; + return wtx; } unsigned int WalletModelTransaction::getTransactionSize() { - return (!walletTransaction ? 0 : ::GetVirtualTransactionSize(*walletTransaction)); + return wtx ? wtx->getVirtualSize() : 0; } CAmount WalletModelTransaction::getTransactionFee() const @@ -41,6 +40,7 @@ void WalletModelTransaction::setTransactionFee(const CAmount& newFee) void WalletModelTransaction::reassignAmounts(int nChangePosRet) { + const CTransaction* walletTransaction = &wtx->get(); int i = 0; for (QList::iterator it = recipients.begin(); it != recipients.end(); ++it) { @@ -80,13 +80,3 @@ CAmount WalletModelTransaction::getTotalTransactionAmount() const } return totalTransactionAmount; } - -void WalletModelTransaction::newPossibleKeyChange(CWallet *wallet) -{ - keyChange.reset(new CReserveKey(wallet)); -} - -CReserveKey *WalletModelTransaction::getPossibleKeyChange() -{ - return keyChange.get(); -} -- cgit v1.2.3