From b8198f5357be81e75986537cf7af84a67e40c45f Mon Sep 17 00:00:00 2001 From: woodser Date: Sun, 7 Mar 2021 11:56:40 -0500 Subject: [PATCH] rename and support export_outputs(bool all=false), import_outputs() --- src/wallet/monero_wallet.h | 13 +++++++------ src/wallet/monero_wallet_full.cpp | 8 ++++---- src/wallet/monero_wallet_full.h | 4 ++-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/wallet/monero_wallet.h b/src/wallet/monero_wallet.h index 898998f..24f95fa 100644 --- a/src/wallet/monero_wallet.h +++ b/src/wallet/monero_wallet.h @@ -748,12 +748,13 @@ namespace monero { } /** - * Export all outputs in hex format. + * Export outputs in hex format. * - * @return all outputs in hex format, empty std::string if no outputs + * @param all exports all outputs if true, else only the outputs since the last export + * @return outputs in hex format, empty std::string if no outputs */ - virtual std::string get_outputs_hex() const { - throw std::runtime_error("get_outputs_hex() not supported"); + virtual std::string export_outputs(bool all = false) const { + throw std::runtime_error("export_outputs() not supported"); } /** @@ -762,8 +763,8 @@ namespace monero { * @param outputs_hex are outputs in hex format * @return the number of outputs imported */ - virtual int import_outputs_hex(const std::string& outputs_hex) { - throw std::runtime_error("import_outputs_hex() not supported"); + virtual int import_outputs(const std::string& outputs_hex) { + throw std::runtime_error("import_outputs() not supported"); } /** diff --git a/src/wallet/monero_wallet_full.cpp b/src/wallet/monero_wallet_full.cpp index 14eb162..73c4d4f 100644 --- a/src/wallet/monero_wallet_full.cpp +++ b/src/wallet/monero_wallet_full.cpp @@ -1652,18 +1652,18 @@ namespace monero { // otherwise get txs with full models to fulfill query std::vector> outputs; for (const std::shared_ptr& tx : get_txs(*(query.m_tx_query.get()))) { - for (const std::shared_ptr& output : tx->filter_outputs_wallet(query)) { // collect queried outputs, erase if excluded + for (const std::shared_ptr& output : tx->filter_outputs_wallet(query)) { // collect queried outputs, erase if excluded outputs.push_back(output); } } return outputs; } - std::string monero_wallet_full::get_outputs_hex() const { - return epee::string_tools::buff_to_hex_nodelimer(m_w2->export_outputs_to_str(true)); + std::string monero_wallet_full::export_outputs(bool all) const { + return epee::string_tools::buff_to_hex_nodelimer(m_w2->export_outputs_to_str(all)); } - int monero_wallet_full::import_outputs_hex(const std::string& outputs_hex) { + int monero_wallet_full::import_outputs(const std::string& outputs_hex) { // validate and parse hex data cryptonote::blobdata blob; diff --git a/src/wallet/monero_wallet_full.h b/src/wallet/monero_wallet_full.h index 946c7af..6056414 100644 --- a/src/wallet/monero_wallet_full.h +++ b/src/wallet/monero_wallet_full.h @@ -224,8 +224,8 @@ namespace monero { std::vector> get_txs(const monero_tx_query& query, std::vector& missing_tx_hashes) const override; std::vector> get_transfers(const monero_transfer_query& query) const override; std::vector> get_outputs(const monero_output_query& query) const override; - std::string get_outputs_hex() const override; - int import_outputs_hex(const std::string& outputs_hex) override; + std::string export_outputs(bool all = false) const override; + int import_outputs(const std::string& outputs_hex) override; std::vector> get_key_images() const override; std::shared_ptr import_key_images(const std::vector>& key_images) override; std::vector> create_txs(const monero_tx_config& config) override;