From e11449378f453c1808c0b7f5c4faa69faf9e0e11 Mon Sep 17 00:00:00 2001 From: Paul Shapiro Date: Wed, 5 Dec 2018 20:07:42 -0600 Subject: [PATCH] async_send_funds args: copies instead of refs to prevent going out of scope exceptions --- src/monero_send_routine.cpp | 2 +- src/monero_send_routine.hpp | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/monero_send_routine.cpp b/src/monero_send_routine.cpp index 77a565d..1c877da 100644 --- a/src/monero_send_routine.cpp +++ b/src/monero_send_routine.cpp @@ -453,7 +453,7 @@ void _reenterable_construct_and_send_tx( // // // Entrypoint -void monero_send_routine::async__send_funds(const Async_SendFunds_Args &args) +void monero_send_routine::async__send_funds(Async_SendFunds_Args args) { uint64_t usable__sending_amount = args.is_sweeping ? 0 : args.sending_amount; crypto::secret_key sec_viewKey{}; diff --git a/src/monero_send_routine.hpp b/src/monero_send_routine.hpp index b7f7522..ac8a44c 100644 --- a/src/monero_send_routine.hpp +++ b/src/monero_send_routine.hpp @@ -177,26 +177,26 @@ namespace monero_send_routine // - Routine entrypoint struct Async_SendFunds_Args { // TODO: add a way to pass native structures if available - const string &from_address_string; - const string &sec_viewKey_string; - const string &sec_spendKey_string; - const string &pub_spendKey_string; - const string &to_address_string; + string from_address_string; + string sec_viewKey_string; + string sec_spendKey_string; + string pub_spendKey_string; + string to_address_string; optional payment_id_string; uint64_t sending_amount; bool is_sweeping; uint32_t simple_priority; - const send__get_unspent_outs_fn_type &get_unspent_outs_fn; - const send__get_random_outs_fn_type &get_random_outs_fn; - const send__submit_raw_tx_fn_type &submit_raw_tx_fn; - const send__status_update_fn_type &status_update_fn; - const send__error_cb_fn_type &error_cb_fn; - const send__success_cb_fn_type &success_cb_fn; + send__get_unspent_outs_fn_type get_unspent_outs_fn; + send__get_random_outs_fn_type get_random_outs_fn; + send__submit_raw_tx_fn_type submit_raw_tx_fn; + send__status_update_fn_type status_update_fn; + send__error_cb_fn_type error_cb_fn; + send__success_cb_fn_type success_cb_fn; // optional unlock_time; // default 0 optional nettype; }; - void async__send_funds(const Async_SendFunds_Args &args); + void async__send_funds(Async_SendFunds_Args args); } #endif /* monero_send_routine_hpp */