mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-03 09:43:55 +02:00
Remove most direct bitcoin calls from qt/walletmodel.cpp
This commit is contained in:
committed by
John Newbery
parent
90d4640b7e
commit
a0704a8996
@@ -4,12 +4,11 @@
|
||||
|
||||
#include <qt/walletmodeltransaction.h>
|
||||
|
||||
#include <interface/node.h>
|
||||
#include <policy/policy.h>
|
||||
#include <wallet/wallet.h>
|
||||
|
||||
WalletModelTransaction::WalletModelTransaction(const QList<SendCoinsRecipient> &_recipients) :
|
||||
recipients(_recipients),
|
||||
walletTransaction(0),
|
||||
fee(0)
|
||||
{
|
||||
}
|
||||
@@ -19,14 +18,14 @@ QList<SendCoinsRecipient> WalletModelTransaction::getRecipients() const
|
||||
return recipients;
|
||||
}
|
||||
|
||||
CTransactionRef& WalletModelTransaction::getTransaction()
|
||||
std::unique_ptr<interface::PendingWalletTx>& 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<SendCoinsRecipient>::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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user