mirror of
https://github.com/monero-project/monero.git
synced 2025-07-22 22:00:41 -04:00
wallet2: try all tx keys when scanning a new transaction
The vast majority of transactions will have just one tx pubkey, but a bug with cold wallet signing caused two such keys to be there, with the second one being the real one.
This commit is contained in:
parent
072d646a45
commit
11ae1873f8
2 changed files with 9 additions and 4 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue