diff options
author | luigi1111 <luigi1111w@gmail.com> | 2019-10-25 16:03:24 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2019-10-25 16:03:24 -0500 |
commit | 07c6789148bcdabaa9e4032e0cb1e11d38196361 (patch) | |
tree | e4e9ca3ae2a789dd9401e311785bc2a80d23dfe9 /src/cryptonote_core | |
parent | Merge pull request #6031 (diff) | |
parent | Fix debug feature (diff) | |
download | monero-07c6789148bcdabaa9e4032e0cb1e11d38196361.tar.xz |
Merge pull request #5958
d25acd7 Add hmac over encrypted value during transaction (clashm)
34f28a7 Add display address (clashm)
235b94e Revert PR #5835 (export view key) (clashm)
32febd2 Fix debug feature (clashm)
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r-- | src/cryptonote_core/cryptonote_tx_utils.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/cryptonote_core/cryptonote_tx_utils.cpp b/src/cryptonote_core/cryptonote_tx_utils.cpp index d2e022347..3e1b4e97f 100644 --- a/src/cryptonote_core/cryptonote_tx_utils.cpp +++ b/src/cryptonote_core/cryptonote_tx_utils.cpp @@ -612,23 +612,27 @@ namespace cryptonote { hw::device &hwdev = sender_account_keys.get_device(); hwdev.open_tx(tx_key); + try { + // figure out if we need to make additional tx pubkeys + size_t num_stdaddresses = 0; + size_t num_subaddresses = 0; + account_public_address single_dest_subaddress; + classify_addresses(destinations, change_addr, num_stdaddresses, num_subaddresses, single_dest_subaddress); + bool need_additional_txkeys = num_subaddresses > 0 && (num_stdaddresses > 0 || num_subaddresses > 1); + if (need_additional_txkeys) + { + additional_tx_keys.clear(); + for (const auto &d: destinations) + additional_tx_keys.push_back(keypair::generate(sender_account_keys.get_device()).sec); + } - // figure out if we need to make additional tx pubkeys - size_t num_stdaddresses = 0; - size_t num_subaddresses = 0; - account_public_address single_dest_subaddress; - classify_addresses(destinations, change_addr, num_stdaddresses, num_subaddresses, single_dest_subaddress); - bool need_additional_txkeys = num_subaddresses > 0 && (num_stdaddresses > 0 || num_subaddresses > 1); - if (need_additional_txkeys) - { - additional_tx_keys.clear(); - for (const auto &d: destinations) - additional_tx_keys.push_back(keypair::generate(sender_account_keys.get_device()).sec); + bool r = construct_tx_with_tx_key(sender_account_keys, subaddresses, sources, destinations, change_addr, extra, tx, unlock_time, tx_key, additional_tx_keys, rct, rct_config, msout); + hwdev.close_tx(); + return r; + } catch(...) { + hwdev.close_tx(); + throw; } - - bool r = construct_tx_with_tx_key(sender_account_keys, subaddresses, sources, destinations, change_addr, extra, tx, unlock_time, tx_key, additional_tx_keys, rct, rct_config, msout); - hwdev.close_tx(); - return r; } //--------------------------------------------------------------- bool construct_tx(const account_keys& sender_account_keys, std::vector<tx_source_entry>& sources, const std::vector<tx_destination_entry>& destinations, const boost::optional<cryptonote::account_public_address>& change_addr, const std::vector<uint8_t> &extra, transaction& tx, uint64_t unlock_time) |