diff options
author | Gregory Sanders <gsanders87@gmail.com> | 2019-07-10 11:37:45 -0400 |
---|---|---|
committer | Gregory Sanders <gsanders87@gmail.com> | 2019-07-10 11:38:37 -0400 |
commit | e10e1e8db043e9b7c113e07faf408f337c1b732d (patch) | |
tree | 17eb6f8da853e1ddb64e6d52b7a371294ec30245 /src/interfaces/wallet.cpp | |
parent | d9ff862f2d24784ee081a8f62a76ffdfe409c10a (diff) |
Restrict lifetime of ReserveDestination to CWallet::CreateTransaction
Diffstat (limited to 'src/interfaces/wallet.cpp')
-rw-r--r-- | src/interfaces/wallet.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/interfaces/wallet.cpp b/src/interfaces/wallet.cpp index c827658dbc..09e78d7f7b 100644 --- a/src/interfaces/wallet.cpp +++ b/src/interfaces/wallet.cpp @@ -36,7 +36,7 @@ namespace { class PendingWalletTxImpl : public PendingWalletTx { public: - explicit PendingWalletTxImpl(CWallet& wallet) : m_wallet(wallet), m_dest(&wallet) {} + explicit PendingWalletTxImpl(CWallet& wallet) : m_wallet(wallet) {} const CTransaction& get() override { return *m_tx; } @@ -47,7 +47,7 @@ public: auto locked_chain = m_wallet.chain().lock(); LOCK(m_wallet.cs_wallet); CValidationState state; - if (!m_wallet.CommitTransaction(m_tx, std::move(value_map), std::move(order_form), m_dest, state)) { + if (!m_wallet.CommitTransaction(m_tx, std::move(value_map), std::move(order_form), state)) { reject_reason = state.GetRejectReason(); return false; } @@ -56,7 +56,6 @@ public: CTransactionRef m_tx; CWallet& m_wallet; - ReserveDestination m_dest; }; //! Construct wallet tx struct. @@ -238,7 +237,7 @@ public: auto locked_chain = m_wallet->chain().lock(); LOCK(m_wallet->cs_wallet); auto pending = MakeUnique<PendingWalletTxImpl>(*m_wallet); - if (!m_wallet->CreateTransaction(*locked_chain, recipients, pending->m_tx, pending->m_dest, fee, change_pos, + if (!m_wallet->CreateTransaction(*locked_chain, recipients, pending->m_tx, fee, change_pos, fail_reason, coin_control, sign)) { return {}; } |