Changeset View
Changeset View
Standalone View
Standalone View
src/qt/walletmodeltransaction.cpp
Show All 12 Lines | WalletModelTransaction::WalletModelTransaction( | ||||
walletTransaction = new CWalletTx(); | walletTransaction = new CWalletTx(); | ||||
} | } | ||||
WalletModelTransaction::~WalletModelTransaction() { | WalletModelTransaction::~WalletModelTransaction() { | ||||
delete keyChange; | delete keyChange; | ||||
delete walletTransaction; | delete walletTransaction; | ||||
} | } | ||||
QList<SendCoinsRecipient> WalletModelTransaction::getRecipients() { | QList<SendCoinsRecipient> WalletModelTransaction::getRecipients() const { | ||||
return recipients; | return recipients; | ||||
} | } | ||||
CWalletTx *WalletModelTransaction::getTransaction() { | CWalletTx *WalletModelTransaction::getTransaction() const { | ||||
return walletTransaction; | return walletTransaction; | ||||
} | } | ||||
unsigned int WalletModelTransaction::getTransactionSize() { | unsigned int WalletModelTransaction::getTransactionSize() { | ||||
return !walletTransaction ? 0 | return !walletTransaction ? 0 | ||||
: CTransaction(*walletTransaction).GetTotalSize(); | : CTransaction(*walletTransaction).GetTotalSize(); | ||||
} | } | ||||
Amount WalletModelTransaction::getTransactionFee() { | Amount WalletModelTransaction::getTransactionFee() const { | ||||
return fee; | return fee; | ||||
} | } | ||||
void WalletModelTransaction::setTransactionFee(const Amount newFee) { | void WalletModelTransaction::setTransactionFee(const Amount newFee) { | ||||
fee = newFee; | fee = newFee; | ||||
} | } | ||||
void WalletModelTransaction::reassignAmounts(int nChangePosRet) { | void WalletModelTransaction::reassignAmounts(int nChangePosRet) { | ||||
Show All 24 Lines | for (SendCoinsRecipient &rcp : recipients) { | ||||
} | } | ||||
rcp.amount = walletTransaction->tx->vout[i].nValue; | rcp.amount = walletTransaction->tx->vout[i].nValue; | ||||
i++; | i++; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
Amount WalletModelTransaction::getTotalTransactionAmount() { | Amount WalletModelTransaction::getTotalTransactionAmount() const { | ||||
Amount totalTransactionAmount = Amount::zero(); | Amount totalTransactionAmount = Amount::zero(); | ||||
for (const SendCoinsRecipient &rcp : recipients) { | for (const SendCoinsRecipient &rcp : recipients) { | ||||
totalTransactionAmount += rcp.amount; | totalTransactionAmount += rcp.amount; | ||||
} | } | ||||
return totalTransactionAmount; | return totalTransactionAmount; | ||||
} | } | ||||
void WalletModelTransaction::newPossibleKeyChange(CWallet *wallet) { | void WalletModelTransaction::newPossibleKeyChange(CWallet *wallet) { | ||||
keyChange = new CReserveKey(wallet); | keyChange = new CReserveKey(wallet); | ||||
} | } | ||||
CReserveKey *WalletModelTransaction::getPossibleKeyChange() { | CReserveKey *WalletModelTransaction::getPossibleKeyChange() { | ||||
return keyChange; | return keyChange; | ||||
} | } |