From 981451c42cb7616bda511f0c0588b8a99fd77bbe Mon Sep 17 00:00:00 2001 From: woodser Date: Sun, 7 Mar 2021 14:33:01 -0500 Subject: [PATCH] rename and support export_key_images(bool all=false) --- src/wallet/monero_wallet.h | 9 +++++---- src/wallet/monero_wallet_full.cpp | 6 +++--- src/wallet/monero_wallet_full.h | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/wallet/monero_wallet.h b/src/wallet/monero_wallet.h index 24f95fa..00f83fb 100644 --- a/src/wallet/monero_wallet.h +++ b/src/wallet/monero_wallet.h @@ -750,7 +750,7 @@ namespace monero { /** * Export outputs in hex format. * - * @param all exports all outputs if true, else only the outputs since the last export + * @param all - export all outputs if true, else export outputs since the last export * @return outputs in hex format, empty std::string if no outputs */ virtual std::string export_outputs(bool all = false) const { @@ -768,12 +768,13 @@ namespace monero { } /** - * Get all signed key images. + * Export signed key images. * + * @param all - export all key images if true, else export key images since the last export * @return the wallet's signed key images */ - virtual std::vector> get_key_images() const { - throw std::runtime_error("get_key_images() not supported"); + virtual std::vector> export_key_images(bool all = false) const { + throw std::runtime_error("export_key_images() not supported"); } /** diff --git a/src/wallet/monero_wallet_full.cpp b/src/wallet/monero_wallet_full.cpp index 73c4d4f..d44d3e9 100644 --- a/src/wallet/monero_wallet_full.cpp +++ b/src/wallet/monero_wallet_full.cpp @@ -1675,12 +1675,12 @@ namespace monero { return m_w2->import_outputs_from_str(blob); } - std::vector> monero_wallet_full::get_key_images() const { - MTRACE("monero_wallet_full::get_key_images()"); + std::vector> monero_wallet_full::export_key_images(bool all) const { + MTRACE("monero_wallet_full::export_key_images()"); // build key images from wallet2 types std::vector> key_images; - std::pair>> ski = m_w2->export_key_images(true); + std::pair>> ski = m_w2->export_key_images(all); for (uint64_t n = 0; n < ski.second.size(); ++n) { std::shared_ptr key_image = std::make_shared(); key_images.push_back(key_image); diff --git a/src/wallet/monero_wallet_full.h b/src/wallet/monero_wallet_full.h index 6056414..0550727 100644 --- a/src/wallet/monero_wallet_full.h +++ b/src/wallet/monero_wallet_full.h @@ -226,7 +226,7 @@ namespace monero { std::vector> get_outputs(const monero_output_query& query) const 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::vector> export_key_images(bool all = false) const override; std::shared_ptr import_key_images(const std::vector>& key_images) override; std::vector> create_txs(const monero_tx_config& config) override; std::vector> sweep_unlocked(const monero_tx_config& config) override;