From d5e250d33a855a126f9b95c1ccc56a93c5b14f14 Mon Sep 17 00:00:00 2001 From: sowle Date: Fri, 8 Oct 2021 07:58:42 +0300 Subject: [PATCH] fix for a typo --- contrib/epee/include/string_tools.h | 2 +- src/currency_core/currency_format_utils.cpp | 18 +++++++++--------- src/currency_core/offers_services_helpers.h | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/contrib/epee/include/string_tools.h b/contrib/epee/include/string_tools.h index a4e67f4c..c5257d95 100644 --- a/contrib/epee/include/string_tools.h +++ b/contrib/epee/include/string_tools.h @@ -284,7 +284,7 @@ POP_GCC_WARNINGS typedef std::map command_line_params_w; template - void apped_pod_to_strbuff(std::string& buff, const t_pod_data& pod) + void append_pod_to_strbuff(std::string& buff, const t_pod_data& pod) { buff.append(reinterpret_cast(&pod), sizeof(pod)); } diff --git a/src/currency_core/currency_format_utils.cpp b/src/currency_core/currency_format_utils.cpp index d78ec011..f76bdd6e 100644 --- a/src/currency_core/currency_format_utils.cpp +++ b/src/currency_core/currency_format_utils.cpp @@ -594,12 +594,12 @@ namespace currency std::string generate_origin_for_htlc(const txout_htlc& htlc, const account_keys& acc_keys) { std::string blob; - string_tools::apped_pod_to_strbuff(blob, htlc.pkey_redeem); - string_tools::apped_pod_to_strbuff(blob, htlc.pkey_refund); - string_tools::apped_pod_to_strbuff(blob, acc_keys.spend_secret_key); + string_tools::append_pod_to_strbuff(blob, htlc.pkey_redeem); + string_tools::append_pod_to_strbuff(blob, htlc.pkey_refund); + string_tools::append_pod_to_strbuff(blob, acc_keys.spend_secret_key); crypto::hash origin_hs = crypto::cn_fast_hash(blob.data(), blob.size()); std::string origin_blob; - string_tools::apped_pod_to_strbuff(origin_blob, origin_hs); + string_tools::append_pod_to_strbuff(origin_blob, origin_hs); return origin_blob; } //--------------------------------------------------------------- @@ -819,7 +819,7 @@ namespace currency //take hash from derivation and use it as a salt crypto::hash derivation_hash = crypto::cn_fast_hash(&derivation_local, sizeof(derivation_local)); std::string salted_body = original_body; - string_tools::apped_pod_to_strbuff(salted_body, derivation_hash); + string_tools::append_pod_to_strbuff(salted_body, derivation_hash); crypto::hash proof_hash = crypto::cn_fast_hash(salted_body.data(), salted_body.size()); sa.security.push_back(*(crypto::public_key*)&proof_hash); } @@ -890,8 +890,8 @@ namespace currency //take hash from derivation and use it as a salt crypto::hash derivation_hash = crypto::cn_fast_hash(&derivation_local, sizeof(derivation_local)); std::string salted_body = local_sa.body; - string_tools::apped_pod_to_strbuff(salted_body, derivation_hash); - crypto::hash proof_hash = crypto::cn_fast_hash(salted_body.data(), salted_body.size()); + string_tools::append_pod_to_strbuff(salted_body, derivation_hash); + crypto::hash proof_hash = crypto::cn_fast_hash(salted_body.data(), salted_body.size()); // proof_hash = Hs(local_sa.body || Hs(s * R)), s - spend secret, R - tx pub CHECK_AND_ASSERT_MES(*(crypto::public_key*)&proof_hash == sa.security.front(), void(), "Proof hash missmatch on decrypting with TX_SERVICE_ATTACHMENT_ENCRYPT_ADD_PROOF"); } @@ -2062,8 +2062,8 @@ namespace currency crypto::hash hash_together(const pod_operand_a& a, const pod_operand_b& b) { std::string blob; - string_tools::apped_pod_to_strbuff(blob, a); - string_tools::apped_pod_to_strbuff(blob, b); + string_tools::append_pod_to_strbuff(blob, a); + string_tools::append_pod_to_strbuff(blob, b); return crypto::cn_fast_hash(blob.data(), blob.size()); } //------------------------------------------------------------------ diff --git a/src/currency_core/offers_services_helpers.h b/src/currency_core/offers_services_helpers.h index fc2203fb..1484622c 100644 --- a/src/currency_core/offers_services_helpers.h +++ b/src/currency_core/offers_services_helpers.h @@ -97,8 +97,8 @@ namespace bc_services inline currency::blobdata make_offer_sig_blob(const update_offer& uo) { currency::blobdata bd; - epee::string_tools::apped_pod_to_strbuff(bd, uo.tx_id); - epee::string_tools::apped_pod_to_strbuff(bd, uo.offer_index); + epee::string_tools::append_pod_to_strbuff(bd, uo.tx_id); + epee::string_tools::append_pod_to_strbuff(bd, uo.offer_index); bd += epee::serialization::store_t_to_binary(uo.of); return bd; } @@ -106,8 +106,8 @@ namespace bc_services inline currency::blobdata make_offer_sig_blob(const cancel_offer& co) { currency::blobdata bd; - epee::string_tools::apped_pod_to_strbuff(bd, co.tx_id); - epee::string_tools::apped_pod_to_strbuff(bd, co.offer_index); + epee::string_tools::append_pod_to_strbuff(bd, co.tx_id); + epee::string_tools::append_pod_to_strbuff(bd, co.offer_index); return bd; }