[wallet] Construct CWalletTx objects in CommitTransaction
Construct CWalletTx objects in CWallet::CommitTransaction, instead of having callers do it. This ensures CWalletTx objects are constructed in a uniform way and all fields are set. This also makes it possible to avoid confusing and wasteful CWalletTx copies in https://github.com/bitcoin/bitcoin/pull/9381 There is no change in behavior.
This commit is contained in:
1 parent
29fad97c32
commit
a128bdc9e1
8 files changed
+68
-74
No files matched your search
@@ -20,11 +20,10 @@ class WalletModelTransaction
|
||||
{
|
||||
public:
|
||||
explicit WalletModelTransaction(const QList<SendCoinsRecipient> &recipients);
|
||||
~WalletModelTransaction();
|
||||
|
||||
QList<SendCoinsRecipient> getRecipients() const;
|
||||
|
||||
CWalletTx *getTransaction() const;
|
||||
CTransactionRef& getTransaction();
|
||||
unsigned int getTransactionSize();
|
||||
|
||||
void setTransactionFee(const CAmount& newFee);
|
||||
@@ -39,7 +38,7 @@ public:
|
||||
|
||||
private:
|
||||
QList<SendCoinsRecipient> recipients;
|
||||
CWalletTx *walletTransaction;
|
||||
CTransactionRef walletTransaction;
|
||||
std::unique_ptr<CReserveKey> keyChange;
|
||||
CAmount fee;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user