From 447d11e02d357fc3e0b6f7bff9920efed6a03363 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Wed, 3 Feb 2021 18:37:57 +0100 Subject: [PATCH] htlc: fixes here and there2 --- src/currency_core/currency_format_utils.cpp | 6 +++--- src/currency_core/currency_format_utils.h | 2 +- tests/core_tests/chaingen.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/currency_core/currency_format_utils.cpp b/src/currency_core/currency_format_utils.cpp index f6aebcc6..501c595e 100644 --- a/src/currency_core/currency_format_utils.cpp +++ b/src/currency_core/currency_format_utils.cpp @@ -206,7 +206,7 @@ namespace currency std::set deriv_cache; for (auto& d : destinations) { - bool r = construct_tx_out(d, txkey.sec, no, tx, deriv_cache); + bool r = construct_tx_out(d, txkey.sec, no, tx, deriv_cache, account_keys()); CHECK_AND_ASSERT_MES(r, false, "Failed to contruct miner tx out"); no++; } @@ -603,7 +603,7 @@ namespace currency return origin_blob; } //--------------------------------------------------------------- - bool construct_tx_out(const tx_destination_entry& de, const crypto::secret_key& tx_sec_key, size_t output_index, transaction& tx, std::set& deriv_cache, uint8_t tx_outs_attr, const account_keys& self) + bool construct_tx_out(const tx_destination_entry& de, const crypto::secret_key& tx_sec_key, size_t output_index, transaction& tx, std::set& deriv_cache, const account_keys& self, uint8_t tx_outs_attr) { CHECK_AND_ASSERT_MES(de.addr.size() == 1 || (de.addr.size() > 1 && de.minimum_sigs <= de.addr.size()), false, "Invalid destination entry: amount: " << de.amount << " minimum_sigs: " << de.minimum_sigs << " addr.size(): " << de.addr.size()); @@ -1290,7 +1290,7 @@ namespace currency for(const tx_destination_entry& dst_entr : shuffled_dsts) { CHECK_AND_ASSERT_MES(dst_entr.amount > 0, false, "Destination with wrong amount: " << dst_entr.amount); - bool r = construct_tx_out(dst_entr, txkey.sec, output_index, tx, deriv_cache, tx_outs_attr, sender_account_keys.account_address); + bool r = construct_tx_out(dst_entr, txkey.sec, output_index, tx, deriv_cache, sender_account_keys, tx_outs_attr); CHECK_AND_ASSERT_MES(r, false, "Failed to construc tx out"); output_index++; summary_outs_money += dst_entr.amount; diff --git a/src/currency_core/currency_format_utils.h b/src/currency_core/currency_format_utils.h index deb20f94..d7d1664e 100644 --- a/src/currency_core/currency_format_utils.h +++ b/src/currency_core/currency_format_utils.h @@ -163,7 +163,7 @@ namespace currency //--------------------------------------------------------------- uint64_t get_string_uint64_hash(const std::string& str); - bool construct_tx_out(const tx_destination_entry& de, const crypto::secret_key& tx_sec_key, size_t output_index, transaction& tx, std::set& deriv_cache, uint8_t tx_outs_attr = CURRENCY_TO_KEY_OUT_RELAXED, const account_public_address& self = account_public_address()); + bool construct_tx_out(const tx_destination_entry& de, const crypto::secret_key& tx_sec_key, size_t output_index, transaction& tx, std::set& deriv_cache, const account_keys& self, uint8_t tx_outs_attr = CURRENCY_TO_KEY_OUT_RELAXED); bool validate_alias_name(const std::string& al); bool validate_password(const std::string& password); void get_attachment_extra_info_details(const std::vector& attachment, extra_attachment_info& eai); diff --git a/tests/core_tests/chaingen.h b/tests/core_tests/chaingen.h index c5731018..8a012d12 100644 --- a/tests/core_tests/chaingen.h +++ b/tests/core_tests/chaingen.h @@ -798,7 +798,7 @@ bool construct_broken_tx(const currency::account_keys& sender_account_keys, cons BOOST_FOREACH(const currency::tx_destination_entry& dst_entr, shuffled_dsts) { CHECK_AND_ASSERT_MES(dst_entr.amount > 0, false, "Destination with wrong amount: " << dst_entr.amount); - bool r = construct_tx_out(dst_entr, txkey.sec, output_index, tx, der_hints, tx_outs_attr); + bool r = construct_tx_out(dst_entr, txkey.sec, output_index, tx, der_hints, sender_account_keys, tx_outs_attr); CHECK_AND_ASSERT_MES(r, false, "Failed to construc tx out"); output_index++; summary_outs_money += dst_entr.amount;