diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-11-17 16:36:12 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-11-17 16:36:12 +0200 |
commit | 2988e1be8ced33d5196611539abaacbb2ac88aa6 (patch) | |
tree | 50f22dcd53acaefcc18916ac71f100e8e98462fa /src/crypto | |
parent | Merge pull request #1337 (diff) | |
parent | wallet: auto sync outputs and key images in cold signing files (diff) | |
download | monero-2988e1be8ced33d5196611539abaacbb2ac88aa6.tar.xz |
Merge pull request #1344
a0131c8 wallet: auto sync outputs and key images in cold signing files (moneromooo-monero)
f806611 wallet2: fill key image and pubkey maps when importing outputs (moneromooo-monero)
5fe363c wallet: cast indices to string in logs to be nice to CLANG (moneromooo-monero)
11ae187 wallet2: try all tx keys when scanning a new transaction (moneromooo-monero)
072d646 wallet2: fill in key image map when importing key images (moneromooo-monero)
23d80b1 core: remove any tx pubkey from extra before adding one (moneromooo-monero)
d72376d simplewallet: add a verbose flag to incoming_transfers (moneromooo-monero)
47413a5 simplewallet: spell out change when signing a transfer (moneromooo-monero)
14cb088 simplewallet: print public keys too on spendkey/viewkey commands (moneromooo-monero)
a99ab49 wallet: fix serialization of new m_key_image_known member (moneromooo-monero)
Diffstat (limited to '')
-rw-r--r-- | src/cryptonote_core/cryptonote_format_utils.cpp | 1 | ||||
-rw-r--r-- | src/cryptonote_core/cryptonote_format_utils.h | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/cryptonote_core/cryptonote_format_utils.cpp b/src/cryptonote_core/cryptonote_format_utils.cpp index 234422e3d..d88f66e3b 100644 --- a/src/cryptonote_core/cryptonote_format_utils.cpp +++ b/src/cryptonote_core/cryptonote_format_utils.cpp @@ -480,6 +480,7 @@ namespace cryptonote tx.extra = extra; keypair txkey = keypair::generate(); + remove_field_from_tx_extra(tx.extra, typeid(tx_extra_pub_key)); add_tx_pub_key_to_extra(tx, txkey.pub); tx_key = txkey.sec; diff --git a/src/cryptonote_core/cryptonote_format_utils.h b/src/cryptonote_core/cryptonote_format_utils.h index d5dd6494d..9f9ed8625 100644 --- a/src/cryptonote_core/cryptonote_format_utils.h +++ b/src/cryptonote_core/cryptonote_format_utils.h @@ -93,9 +93,9 @@ namespace cryptonote bool construct_tx_and_get_tx_key(const account_keys& sender_account_keys, const std::vector<tx_source_entry>& sources, const std::vector<tx_destination_entry>& destinations, std::vector<uint8_t> extra, transaction& tx, uint64_t unlock_time, crypto::secret_key &tx_key, bool rct = false); template<typename T> - bool find_tx_extra_field_by_type(const std::vector<tx_extra_field>& tx_extra_fields, T& field) + bool find_tx_extra_field_by_type(const std::vector<tx_extra_field>& tx_extra_fields, T& field, size_t index = 0) { - auto it = std::find_if(tx_extra_fields.begin(), tx_extra_fields.end(), [](const tx_extra_field& f) { return typeid(T) == f.type(); }); + auto it = std::find_if(tx_extra_fields.begin(), tx_extra_fields.end(), [&index](const tx_extra_field& f) { return typeid(T) == f.type() && !index--; }); if(tx_extra_fields.end() == it) return false; |