From e916201f12363760a84fdff0584a8a250f03847b Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 8 Aug 2020 14:39:04 +0000 Subject: [PATCH 1/2] wallet2: fix setting tx keys when another is already set insert doesn't actually insert if another element with the same key is already in the map --- src/wallet/wallet2.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index d7ed3e999..fe8d77b0b 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -6512,8 +6512,8 @@ void wallet2::commit_tx(pending_tx& ptx) add_unconfirmed_tx(ptx.tx, amount_in, dests, payment_id, ptx.change_dts.amount, ptx.construction_data.subaddr_account, ptx.construction_data.subaddr_indices); if (store_tx_info() && ptx.tx_key != crypto::null_skey) { - m_tx_keys.insert(std::make_pair(txid, ptx.tx_key)); - m_additional_tx_keys.insert(std::make_pair(txid, ptx.additional_tx_keys)); + m_tx_keys[txid] = ptx.tx_key; + m_additional_tx_keys[txid] = ptx.additional_tx_keys; } LOG_PRINT_L2("transaction " << txid << " generated ok and sent to daemon, key_images: [" << ptx.key_images << "]"); @@ -6702,8 +6702,8 @@ bool wallet2::sign_tx(unsigned_tx_set &exported_txs, std::vector Date: Mon, 10 Aug 2020 21:25:51 +0000 Subject: [PATCH 2/2] simplewallet: allow setting tx keys when sending to a subaddress The tx key derivation is different then --- src/simplewallet/simplewallet.cpp | 24 +++++++++++++++++++++--- src/wallet/wallet2.cpp | 12 +++++++++++- src/wallet/wallet2.h | 2 +- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index d36e5009b..bd27255aa 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -208,7 +208,7 @@ namespace const char* USAGE_ADDRESS_BOOK("address_book [(add (
|) [])|(delete )]"); const char* USAGE_SET_VARIABLE("set