summaryrefslogtreecommitdiff
path: root/patches/monero/0005-UR-functions.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/monero/0005-UR-functions.patch')
-rw-r--r--patches/monero/0005-UR-functions.patch243
1 files changed, 86 insertions, 157 deletions
diff --git a/patches/monero/0005-UR-functions.patch b/patches/monero/0005-UR-functions.patch
index 116d050..95296e6 100644
--- a/patches/monero/0005-UR-functions.patch
+++ b/patches/monero/0005-UR-functions.patch
@@ -1,7 +1,7 @@
-From ccd02185be7d4a928776ff38111eb3ce9face61f Mon Sep 17 00:00:00 2001
+From b8b0ff67a9a6eb1dd18a259cfa9c136336d1101a Mon Sep 17 00:00:00 2001
From: tobtoht <tob@featherwallet.org>
Date: Tue, 12 Mar 2024 10:09:50 +0100
-Subject: [PATCH 05/20] UR functions
+Subject: [PATCH 05/17] UR functions
This commit adds UR functions for UR tasks,
I believe that the right place to get
@@ -20,10 +20,9 @@ Things broken in the commit
of this patch) it is not a dealbreaker.
---
.gitmodules | 4 +
- CMakeLists.txt | 4 +-
+ CMakeLists.txt | 1 +
external/CMakeLists.txt | 1 +
- external/bc-ur | 1 +
- src/device/device_ledger.cpp | 5 +-
+ src/device/device_ledger.cpp | 4 +-
src/wallet/CMakeLists.txt | 1 +
src/wallet/api/pending_transaction.cpp | 33 +++
src/wallet/api/pending_transaction.h | 1 +
@@ -32,96 +31,77 @@ Things broken in the commit
src/wallet/api/wallet.cpp | 307 ++++++++++++++++++++++++
src/wallet/api/wallet.h | 8 +
src/wallet/api/wallet2_api.h | 22 +-
- src/wallet/wallet2.cpp | 141 +++++++----
+ src/wallet/wallet2.cpp | 94 ++++++--
src/wallet/wallet2.h | 3 +
- 15 files changed, 518 insertions(+), 56 deletions(-)
- create mode 160000 external/bc-ur
+ 14 files changed, 492 insertions(+), 30 deletions(-)
diff --git a/.gitmodules b/.gitmodules
-index ffb73fe9a..72af74d55 100644
+index e9568bc46..8abd99092 100644
--- a/.gitmodules
+++ b/.gitmodules
-@@ -15,3 +15,7 @@
- path = external/supercop
- url = https://github.com/monero-project/supercop
- branch = monero
+@@ -21,3 +21,7 @@
+ path = external/mx25519
+ url = https://github.com/jeffro256/mx25519
+ branch = unclamped
+[submodule "external/bc-ur"]
+ path = external/bc-ur
+ url = https://github.com/MrCyjaneK/bc-ur
+ branch = misc
diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 9b922046e..268339201 100644
+index 4d96243d4..ee46cabcd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -96,7 +96,8 @@ enable_language(C ASM)
- set(CMAKE_C_STANDARD 11)
- set(CMAKE_C_STANDARD_REQUIRED ON)
+@@ -103,6 +103,7 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)
--set(CMAKE_CXX_STANDARD 14)
-+set(CMAKE_CXX_STANDARD 17)
-+add_definitions(-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES) # boost: no template named 'unary_function' in namespace 'std'; did you mean '__unary_function'?
+ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
++add_definitions(-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES) # boost: no template named 'unary_function' in namespace 'std'; did you mean '__unary_function'?
set(CMAKE_CXX_EXTENSIONS OFF)
-@@ -364,6 +365,7 @@ if(NOT MANUAL_SUBMODULES)
- endfunction ()
-
- message(STATUS "Checking submodules")
-+# check_submodule(external/bc-ur)
- check_submodule(external/miniupnp)
- check_submodule(external/rapidjson)
- check_submodule(external/trezor-common)
+ function (die msg)
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
-index 538e4d215..074e23f16 100644
+index b16723b63..9d3bcd853 100644
--- a/external/CMakeLists.txt
+++ b/external/CMakeLists.txt
-@@ -70,4 +70,5 @@ endif()
+@@ -66,5 +66,6 @@ endif()
add_subdirectory(db_drivers)
add_subdirectory(easylogging++)
add_subdirectory(qrcodegen)
+add_subdirectory(bc-ur)
add_subdirectory(randomx EXCLUDE_FROM_ALL)
-diff --git a/external/bc-ur b/external/bc-ur
-new file mode 160000
-index 000000000..d82e7c753
---- /dev/null
-+++ b/external/bc-ur
-@@ -0,0 +1 @@
-+Subproject commit d82e7c753e710b8000706dc3383b498438795208
+ add_subdirectory(mx25519)
diff --git a/src/device/device_ledger.cpp b/src/device/device_ledger.cpp
-index 6dde4a564..7e4be6347 100644
+index 7369620ca..45a01abd0 100644
--- a/src/device/device_ledger.cpp
+++ b/src/device/device_ledger.cpp
-@@ -313,12 +313,13 @@ namespace hw {
-
- /* ======================================================================= */
+@@ -316,10 +316,12 @@ namespace hw {
/* LOCKER */
-- /* ======================================================================= */
-+ /* ======================================================================= */
+ /* ======================================================================= */
- //automatic lock one more level on device ensuring the current thread is allowed to use it
+ #pragma message ("Warning AUTO_LOCK_CMD is intentionally left broken. This is yet to be fixed.")
++
+ //automatic lock one more level on device ensuring the current thread is allowed to use it
#define AUTO_LOCK_CMD() \
/* lock both mutexes without deadlock*/ \
-- boost::lock(device_locker, command_locker); \
-+ /* boost::lock(device_locker, command_locker); */ \
+- std::lock(device_locker, command_locker); \
++ /* std::lock(device_locker, command_locker); */ \
/* make sure both already-locked mutexes are unlocked at the end of scope */ \
- boost::lock_guard<boost::recursive_mutex> lock1(device_locker, boost::adopt_lock); \
- boost::lock_guard<boost::mutex> lock2(command_locker, boost::adopt_lock)
+ std::lock_guard<std::recursive_mutex> lock1(device_locker, std::adopt_lock); \
+ std::lock_guard<std::mutex> lock2(command_locker, std::adopt_lock)
diff --git a/src/wallet/CMakeLists.txt b/src/wallet/CMakeLists.txt
-index 6095f99d5..b163212b7 100644
+index 9bffe76be..f128d5c0c 100644
--- a/src/wallet/CMakeLists.txt
+++ b/src/wallet/CMakeLists.txt
-@@ -50,6 +50,7 @@ monero_add_library(wallet
+@@ -52,6 +52,7 @@ monero_add_library(wallet
target_link_libraries(wallet
PUBLIC
rpc_base
+ bc-ur
multisig
+ carrot_impl
common
- cryptonote_core
diff --git a/src/wallet/api/pending_transaction.cpp b/src/wallet/api/pending_transaction.cpp
-index 70a702796..9c3c26ee5 100644
+index 1618b915d..919e210f0 100644
--- a/src/wallet/api/pending_transaction.cpp
+++ b/src/wallet/api/pending_transaction.cpp
@@ -42,6 +42,8 @@
@@ -172,7 +152,7 @@ index 70a702796..9c3c26ee5 100644
{
uint64_t result = 0;
diff --git a/src/wallet/api/pending_transaction.h b/src/wallet/api/pending_transaction.h
-index 0a9779c07..403bfe281 100644
+index 9d8d754c0..8a70d774d 100644
--- a/src/wallet/api/pending_transaction.h
+++ b/src/wallet/api/pending_transaction.h
@@ -46,6 +46,7 @@ public:
@@ -184,7 +164,7 @@ index 0a9779c07..403bfe281 100644
uint64_t dust() const override;
uint64_t fee() const override;
diff --git a/src/wallet/api/unsigned_transaction.cpp b/src/wallet/api/unsigned_transaction.cpp
-index 6165a2240..fd03e959d 100644
+index c549539e5..062df7f41 100644
--- a/src/wallet/api/unsigned_transaction.cpp
+++ b/src/wallet/api/unsigned_transaction.cpp
@@ -40,6 +40,8 @@
@@ -244,7 +224,7 @@ index 6165a2240..fd03e959d 100644
bool UnsignedTransactionImpl::checkLoadedTx(const std::function<size_t()> get_num_txes, const std::function<const tools::wallet2::tx_construction_data&(size_t)> &get_tx, const std::string &extra_message)
{
diff --git a/src/wallet/api/unsigned_transaction.h b/src/wallet/api/unsigned_transaction.h
-index 30065a7fa..a94b23f75 100644
+index b07d43fb1..76165a230 100644
--- a/src/wallet/api/unsigned_transaction.h
+++ b/src/wallet/api/unsigned_transaction.h
@@ -53,6 +53,7 @@ public:
@@ -256,18 +236,18 @@ index 30065a7fa..a94b23f75 100644
uint64_t minMixinCount() const override;
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
-index 6301bd1ef..d179e502b 100644
+index b6ce7b05a..b1ffe77a7 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
-@@ -47,6 +47,7 @@
+@@ -51,6 +51,7 @@
+ #endif
- #include <boost/locale.hpp>
#include <boost/filesystem.hpp>
+#include "bc-ur/src/bc-ur.hpp"
using namespace std;
using namespace cryptonote;
-@@ -1066,6 +1067,24 @@ uint64_t WalletImpl::unlockedBalance(uint32_t accountIndex) const
+@@ -1012,6 +1013,24 @@ uint64_t WalletImpl::unlockedBalance(uint32_t accountIndex) const
return m_wallet->unlocked_balance(accountIndex, false);
}
@@ -291,8 +271,8 @@ index 6301bd1ef..d179e502b 100644
+
uint64_t WalletImpl::blockChainHeight() const
{
- if(m_wallet->light_wallet()) {
-@@ -1208,6 +1227,61 @@ UnsignedTransaction *WalletImpl::loadUnsignedTx(const std::string &unsigned_file
+ return m_wallet->get_blockchain_current_height();
+@@ -1145,6 +1164,61 @@ UnsignedTransaction *WalletImpl::loadUnsignedTx(const std::string &unsigned_file
return transaction;
}
@@ -354,7 +334,7 @@ index 6301bd1ef..d179e502b 100644
bool WalletImpl::submitTransaction(const string &fileName) {
clearStatus();
if (checkBackgroundSync("cannot submit tx"))
-@@ -1228,6 +1302,61 @@ bool WalletImpl::submitTransaction(const string &fileName) {
+@@ -1165,6 +1239,61 @@ bool WalletImpl::submitTransaction(const string &fileName) {
return true;
}
@@ -416,7 +396,7 @@ index 6301bd1ef..d179e502b 100644
bool WalletImpl::exportKeyImages(const string &filename, bool all)
{
if (m_wallet->watch_only())
-@@ -1255,6 +1384,39 @@ bool WalletImpl::exportKeyImages(const string &filename, bool all)
+@@ -1192,6 +1321,39 @@ bool WalletImpl::exportKeyImages(const string &filename, bool all)
return true;
}
@@ -456,7 +436,7 @@ index 6301bd1ef..d179e502b 100644
bool WalletImpl::importKeyImages(const string &filename)
{
if (checkBackgroundSync("cannot import key images"))
-@@ -1280,6 +1442,62 @@ bool WalletImpl::importKeyImages(const string &filename)
+@@ -1217,6 +1379,62 @@ bool WalletImpl::importKeyImages(const string &filename)
return true;
}
@@ -519,7 +499,7 @@ index 6301bd1ef..d179e502b 100644
bool WalletImpl::exportOutputs(const string &filename, bool all)
{
if (checkBackgroundSync("cannot export outputs"))
-@@ -1312,6 +1530,40 @@ bool WalletImpl::exportOutputs(const string &filename, bool all)
+@@ -1249,6 +1467,40 @@ bool WalletImpl::exportOutputs(const string &filename, bool all)
return true;
}
@@ -560,7 +540,7 @@ index 6301bd1ef..d179e502b 100644
bool WalletImpl::importOutputs(const string &filename)
{
if (checkBackgroundSync("cannot import outputs"))
-@@ -1346,6 +1598,61 @@ bool WalletImpl::importOutputs(const string &filename)
+@@ -1283,6 +1535,61 @@ bool WalletImpl::importOutputs(const string &filename)
return true;
}
@@ -623,10 +603,10 @@ index 6301bd1ef..d179e502b 100644
{
if (checkBackgroundSync("cannot scan transactions"))
diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h
-index ac7ce2f6a..edf8bb8ce 100644
+index 365025c6e..a50983a69 100644
--- a/src/wallet/api/wallet.h
+++ b/src/wallet/api/wallet.h
-@@ -112,6 +112,7 @@ public:
+@@ -113,6 +113,7 @@ public:
bool setProxy(const std::string &address) override;
uint64_t balance(uint32_t accountIndex = 0) const override;
uint64_t unlockedBalance(uint32_t accountIndex = 0) const override;
@@ -634,7 +614,7 @@ index ac7ce2f6a..edf8bb8ce 100644
uint64_t blockChainHeight() const override;
uint64_t approximateBlockChainHeight() const override;
uint64_t estimateBlockChainHeight() const override;
-@@ -164,11 +165,18 @@ public:
+@@ -166,11 +167,18 @@ public:
std::set<uint32_t> subaddr_indices = {}) override;
virtual PendingTransaction * createSweepUnmixableTransaction() override;
bool submitTransaction(const std::string &fileName) override;
@@ -654,10 +634,10 @@ index ac7ce2f6a..edf8bb8ce 100644
bool setupBackgroundSync(const BackgroundSyncType background_sync_type, const std::string &wallet_password, const optional<std::string> &background_cache_password = optional<std::string>()) override;
diff --git a/src/wallet/api/wallet2_api.h b/src/wallet/api/wallet2_api.h
-index e349df176..764adbfbf 100644
+index 2bedcc7d2..308bcad4b 100644
--- a/src/wallet/api/wallet2_api.h
+++ b/src/wallet/api/wallet2_api.h
-@@ -91,6 +91,7 @@ struct PendingTransaction
+@@ -83,6 +83,7 @@ struct PendingTransaction
virtual std::string errorString() const = 0;
// commit transaction or save to file if filename is provided.
virtual bool commit(const std::string &filename = "", bool overwrite = false) = 0;
@@ -665,7 +645,7 @@ index e349df176..764adbfbf 100644
virtual uint64_t amount() const = 0;
virtual uint64_t dust() const = 0;
virtual uint64_t fee() const = 0;
-@@ -160,7 +161,8 @@ struct UnsignedTransaction
+@@ -152,7 +153,8 @@ struct UnsignedTransaction
* @param signedFileName
* return - true on success
*/
@@ -675,7 +655,7 @@ index e349df176..764adbfbf 100644
};
/**
-@@ -626,6 +628,7 @@ struct Wallet
+@@ -619,6 +621,7 @@ struct Wallet
result += unlockedBalance(i);
return result;
}
@@ -683,7 +663,7 @@ index e349df176..764adbfbf 100644
/**
* @brief watchOnly - checks if wallet is watch only
-@@ -884,13 +887,15 @@ struct Wallet
+@@ -886,13 +889,15 @@ struct Wallet
* after object returned
*/
virtual UnsignedTransaction * loadUnsignedTx(const std::string &unsigned_filename) = 0;
@@ -702,7 +682,7 @@ index e349df176..764adbfbf 100644
/*!
* \brief disposeTransaction - destroys transaction object
-@@ -906,6 +911,8 @@ struct Wallet
+@@ -908,6 +913,8 @@ struct Wallet
virtual uint64_t estimateTransactionFee(const std::vector<std::pair<std::string, uint64_t>> &destinations,
PendingTransaction::Priority priority) const = 0;
@@ -711,7 +691,7 @@ index e349df176..764adbfbf 100644
/*!
* \brief exportKeyImages - exports key images to file
* \param filename
-@@ -913,20 +920,22 @@ struct Wallet
+@@ -915,20 +922,22 @@ struct Wallet
* \return - true on success
*/
virtual bool exportKeyImages(const std::string &filename, bool all = false) = 0;
@@ -736,7 +716,7 @@ index e349df176..764adbfbf 100644
/*!
* \brief importOutputs - imports outputs from file
-@@ -934,6 +943,7 @@ struct Wallet
+@@ -936,6 +945,7 @@ struct Wallet
* \return - true on success
*/
virtual bool importOutputs(const std::string &filename) = 0;
@@ -745,10 +725,10 @@ index e349df176..764adbfbf 100644
/*!
* \brief scanTransactions - scan a list of transaction ids, this operation may reveal the txids to the remote node and affect your privacy
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
-index ac2a1fec3..a8db99c3f 100644
+index 2c2268f7a..131c9cccf 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
-@@ -953,6 +953,16 @@ uint32_t get_subaddress_clamped_sum(uint32_t idx, uint32_t extra)
+@@ -974,6 +974,16 @@ uint32_t get_subaddress_clamped_sum(uint32_t idx, uint32_t extra)
return idx + extra;
}
@@ -765,7 +745,7 @@ index ac2a1fec3..a8db99c3f 100644
static void setup_shim(hw::wallet_shim * shim, tools::wallet2 * wallet)
{
shim->get_tx_pub_key_from_received_outs = std::bind(&tools::wallet2::get_tx_pub_key_from_received_outs, wallet, std::placeholders::_1);
-@@ -7065,6 +7075,25 @@ uint64_t wallet2::unlocked_balance(uint32_t index_major, bool strict, uint64_t *
+@@ -7311,6 +7321,25 @@ uint64_t wallet2::unlocked_balance(uint32_t index_major, bool strict, uint64_t *
return amount;
}
//----------------------------------------------------------------------------------------------------
@@ -791,18 +771,7 @@ index ac2a1fec3..a8db99c3f 100644
std::map<uint32_t, uint64_t> wallet2::balance_per_subaddress(uint32_t index_major, bool strict) const
{
std::map<uint32_t, uint64_t> amount_per_subaddr;
-@@ -7916,9 +7945,7 @@ bool wallet2::sign_tx(unsigned_tx_set &exported_txs, std::vector<wallet2::pendin
- crypto::key_derivation derivation;
- std::vector<crypto::key_derivation> additional_derivations;
-
-- // compute public keys from out secret keys
-- crypto::public_key tx_pub_key;
-- crypto::secret_key_to_public_key(txs[n].tx_key, tx_pub_key);
-+ crypto::public_key tx_pub_key = get_tx_pub_key_from_extra(tx);
- std::vector<crypto::public_key> additional_tx_pub_keys;
- for (const crypto::secret_key &skey: txs[n].additional_tx_keys)
- {
-@@ -11261,7 +11288,7 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_2(std::vector<cryp
+@@ -10901,7 +10930,7 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_2(
MDEBUG("Ignoring output " << i << " of amount " << print_money(td.amount()) << " which is below fractional threshold " << print_money(fractional_threshold));
continue;
}
@@ -811,7 +780,7 @@ index ac2a1fec3..a8db99c3f 100644
{
if (td.amount() > m_ignore_outputs_above || td.amount() < m_ignore_outputs_below)
{
-@@ -11311,9 +11338,15 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_2(std::vector<cryp
+@@ -10951,9 +10980,15 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_2(
LOG_PRINT_L2("Starting with " << num_nondust_outputs << " non-dust outputs and " << num_dust_outputs << " dust outputs");
@@ -829,71 +798,31 @@ index ac2a1fec3..a8db99c3f 100644
// if empty, put dummy entry so that the front can be referenced later in the loop
if (unused_dust_indices_per_subaddr.empty())
unused_dust_indices_per_subaddr.push_back({});
-@@ -13949,33 +13982,40 @@ crypto::public_key wallet2::get_tx_pub_key_from_received_outs(const tools::walle
-
- bool wallet2::export_key_images(const std::string &filename, bool all) const
- {
-- PERF_TIMER(export_key_images);
-- std::pair<uint64_t, std::vector<std::pair<crypto::key_image, crypto::signature>>> ski = export_key_images(all);
-- std::string magic(KEY_IMAGE_EXPORT_FILE_MAGIC, strlen(KEY_IMAGE_EXPORT_FILE_MAGIC));
-- const cryptonote::account_public_address &keys = get_account().get_keys().m_account_address;
-- const uint32_t offset = ski.first;
-+ std::string data = export_key_images_str(all);
-+ return save_to_file(filename, data);
-+}
-
-- std::string data;
-- data.reserve(4 + ski.second.size() * (sizeof(crypto::key_image) + sizeof(crypto::signature)) + 2 * sizeof(crypto::public_key));
-- data.resize(4);
-- data[0] = offset & 0xff;
-- data[1] = (offset >> 8) & 0xff;
-- data[2] = (offset >> 16) & 0xff;
-- data[3] = (offset >> 24) & 0xff;
-- data += std::string((const char *)&keys.m_spend_public_key, sizeof(crypto::public_key));
-- data += std::string((const char *)&keys.m_view_public_key, sizeof(crypto::public_key));
-- for (const auto &i: ski.second)
-- {
-- data += std::string((const char *)&i.first, sizeof(crypto::key_image));
-- data += std::string((const char *)&i.second, sizeof(crypto::signature));
-- }
-+std::string wallet2::export_key_images_str(bool all) const
+@@ -13556,7 +13591,13 @@ crypto::public_key wallet2::get_tx_pub_key_from_received_outs(const tools::walle
+ return main_tx_pubkey;
+ }
+ //----------------------------------------------------------------------------------------------------
+-bool wallet2::export_key_images(const std::string &filename, bool all) const
++bool wallet2::export_key_images(bool all) const
+{
-+ PERF_TIMER(export_key_images);
-+ std::pair<uint64_t, std::vector<std::pair<crypto::key_image, crypto::signature>>> ski = export_key_images(all);
-+ std::string magic(KEY_IMAGE_EXPORT_FILE_MAGIC, strlen(KEY_IMAGE_EXPORT_FILE_MAGIC));
-+ const cryptonote::account_public_address &keys = get_account().get_keys().m_account_address;
-+ const uint32_t offset = ski.first;
-
-- // encrypt data, keep magic plaintext
-- PERF_TIMER(export_key_images_encrypt);
-- std::string ciphertext = encrypt_with_view_secret_key(data);
-- return save_to_file(filename, magic + ciphertext);
-+ std::string data;
-+ data.reserve(4 + ski.second.size() * (sizeof(crypto::key_image) + sizeof(crypto::signature)) + 2 * sizeof(crypto::public_key));
-+ data.resize(4);
-+ data[0] = offset & 0xff;
-+ data[1] = (offset >> 8) & 0xff;
-+ data[2] = (offset >> 16) & 0xff;
-+ data[3] = (offset >> 24) & 0xff;
-+ data += std::string((const char *)&keys.m_spend_public_key, sizeof(crypto::public_key));
-+ data += std::string((const char *)&keys.m_view_public_key, sizeof(crypto::public_key));
-+ for (const auto &i: ski.second)
-+ {
-+ data += std::string((const char *)&i.first, sizeof(crypto::key_image));
-+ data += std::string((const char *)&i.second, sizeof(crypto::signature));
-+ }
++ std::string data = export_key_images_str(all);
++ return save_to_file(filename, data);
++}
+
-+ // encrypt data, keep magic plaintext
-+ PERF_TIMER(export_key_images_encrypt);
-+ std::string ciphertext = encrypt_with_view_secret_key(data);
-+ return magic + ciphertext;
++std::string wallet2::export_key_images_str(const std::string &filename, bool all) const
+ {
+ PERF_TIMER(export_key_images);
+ std::pair<uint64_t, std::vector<std::pair<crypto::key_image, crypto::signature>>> ski = export_key_images(all);
+@@ -13582,7 +13623,7 @@ bool wallet2::export_key_images(const std::string &filename, bool all) const
+ // encrypt data, keep magic plaintext
+ PERF_TIMER(export_key_images_encrypt);
+ std::string ciphertext = encrypt_with_view_secret_key(data);
+- return save_to_file(filename, magic + ciphertext);
++ return magic + ciphertext;
}
-+
//----------------------------------------------------------------------------------------------------
- std::pair<uint64_t, std::vector<std::pair<crypto::key_image, crypto::signature>>> wallet2::export_key_images(bool all) const
- {
-@@ -14030,53 +14070,60 @@ std::pair<uint64_t, std::vector<std::pair<crypto::key_image, crypto::signature>>
+@@ -13639,53 +13680,60 @@ std::pair<uint64_t, std::vector<std::pair<crypto::key_image, crypto::signature>>
return std::make_pair(offset, ski);
}
@@ -973,10 +902,10 @@ index ac2a1fec3..a8db99c3f 100644
ski.push_back(std::make_pair(key_image, signature));
}
diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h
-index 92f735f96..18e60d89a 100644
+index 31f9aa913..e7dfd0ddf 100644
--- a/src/wallet/wallet2.h
+++ b/src/wallet/wallet2.h
-@@ -1164,6 +1164,7 @@ private:
+@@ -670,6 +670,7 @@ private:
// locked & unlocked balance of given or current subaddress account
uint64_t balance(uint32_t subaddr_index_major, bool strict) const;
uint64_t unlocked_balance(uint32_t subaddr_index_major, bool strict, uint64_t *blocks_to_unlock = NULL, uint64_t *time_to_unlock = NULL);
@@ -984,7 +913,7 @@ index 92f735f96..18e60d89a 100644
// locked & unlocked balance per subaddress of given or current subaddress account
std::map<uint32_t, uint64_t> balance_per_subaddress(uint32_t subaddr_index_major, bool strict) const;
std::map<uint32_t, std::pair<uint64_t, std::pair<uint64_t, uint64_t>>> unlocked_balance_per_subaddress(uint32_t subaddr_index_major, bool strict);
-@@ -1639,9 +1640,11 @@ private:
+@@ -1199,9 +1200,11 @@ private:
std::tuple<size_t, crypto::hash, std::vector<crypto::hash>> export_blockchain() const;
void import_blockchain(const std::tuple<size_t, crypto::hash, std::vector<crypto::hash>> &bc);
bool export_key_images(const std::string &filename, bool all = false) const;
@@ -997,5 +926,5 @@ index 92f735f96..18e60d89a 100644
bool import_key_images(signed_tx_set & signed_tx, size_t offset=0, bool only_selected_transfers=false);
crypto::public_key get_tx_pub_key_from_received_outs(const tools::wallet2::transfer_details &td) const;
--
-2.50.1 (Apple Git-155)
+2.51.0