From b5cbd1dae401963ba9cc6bff75d45175b5c2c91f Mon Sep 17 00:00:00 2001 From: woodser Date: Sun, 23 Feb 2020 18:26:41 -0500 Subject: [PATCH] update get_keys_file_buffer() to use boost::optional return type --- src/wallet/monero_wallet_core.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/wallet/monero_wallet_core.cpp b/src/wallet/monero_wallet_core.cpp index d99ea69..0ec88cc 100644 --- a/src/wallet/monero_wallet_core.cpp +++ b/src/wallet/monero_wallet_core.cpp @@ -3158,22 +3158,15 @@ namespace monero { } std::string monero_wallet_core::get_keys_file_buffer(const epee::wipeable_string& password, bool watch_only) const { - wallet2::keys_file_data keys_file_data = {}; - bool r = m_w2->get_keys_file_data(password, watch_only, keys_file_data); + boost::optional keys_file_data = m_w2->get_keys_file_data(password, watch_only); std::string buf; - ::serialization::dump_binary(keys_file_data, buf); + ::serialization::dump_binary(keys_file_data.get(), buf); return buf; } std::string monero_wallet_core::get_cache_file_buffer(const epee::wipeable_string& password) const { wallet2::cache_file_data cache_file_data = {}; bool r = m_w2->get_cache_file_data(password, cache_file_data); - -// std::ostringstream oss; -// binary_archive oar(oss); -// bool success = ::serialization::serialize(oar, cache_file_data); -// return oss.str(); - std::string buf; ::serialization::dump_binary(cache_file_data, buf); return buf;