From fd637b4d1c303a5b8fed129d8e6c397997f84c96 Mon Sep 17 00:00:00 2001 From: woodser Date: Tue, 20 Aug 2019 09:52:46 -0400 Subject: [PATCH] send requests are const and copied to preserve original --- src/wallet/monero_wallet.cpp | 7 ++++--- src/wallet/monero_wallet.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/wallet/monero_wallet.cpp b/src/wallet/monero_wallet.cpp index 085db36..657e2dc 100644 --- a/src/wallet/monero_wallet.cpp +++ b/src/wallet/monero_wallet.cpp @@ -1842,10 +1842,11 @@ namespace monero { return relay_txs(tx_hexes); } - monero_tx_set monero_wallet::send(monero_send_request& request) { + monero_tx_set monero_wallet::send(const monero_send_request& request) { if (request.m_can_split != boost::none && request.m_can_split.get()) throw runtime_error("Cannot request split transactions with send() which prevents splitting; use sendSplit() instead"); - request.m_can_split = false; - return send_split(request); + monero_send_request copy = request.copy(); + copy.m_can_split = false; + return send_split(copy); } monero_tx_set monero_wallet::send(uint32_t account_index, string address, uint64_t amount) { diff --git a/src/wallet/monero_wallet.h b/src/wallet/monero_wallet.h index 2af2e84..aab0e4f 100644 --- a/src/wallet/monero_wallet.h +++ b/src/wallet/monero_wallet.h @@ -855,7 +855,7 @@ namespace monero { * @param request configures the transaction * @return a tx set with the requested transaction if possible */ - monero_tx_set send(monero_send_request& request); + monero_tx_set send(const monero_send_request& request); /** * Create and relay a transaction to transfers funds from this wallet to