diff --git a/src/currency_core/currency_format_utils.h b/src/currency_core/currency_format_utils.h index ce7642b9..b53931e3 100644 --- a/src/currency_core/currency_format_utils.h +++ b/src/currency_core/currency_format_utils.h @@ -433,8 +433,7 @@ namespace currency ai.m_alias = ard.alias; return true; } - - + //--------------------------------------------------------------- template extra_t& get_or_add_field_to_extra(std::vector& extra) { @@ -446,6 +445,7 @@ namespace currency extra.push_back(extra_t()); return boost::get(extra.back()); } + //--------------------------------------------------------------- template void update_or_add_field_to_extra(std::vector& variant_container, const variant_type_t& v) { @@ -461,19 +461,6 @@ namespace currency } //--------------------------------------------------------------- template - bool has_field_of_type_in_extra(std::vector& variant_container) - { - for (auto& ev : variant_container) - { - if (ev.type() == typeid(variant_type_t)) - { - return true; - } - } - return false; - } - //--------------------------------------------------------------- - template void remove_field_of_type_from_extra(std::vector& variant_container) { for (size_t i = 0; i != variant_container.size();) @@ -488,7 +475,6 @@ namespace currency } } } - //--------------------------------------------------------------- template bool get_payment_id_from_tx(const t_container& att, std::string& payment_id) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 279bfc36..036057f2 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -1184,7 +1184,7 @@ void wallet2::prepare_wti(wallet_public::wallet_transfer_info& wti, uint64_t hei decrypt_payload_items(decrypt_attachment_as_income, tx, m_account.get_keys(), decrypted_att); - if ((is_watch_only() && !wti.is_income)|| (height > 638000 && !has_field_of_type_in_extra(decrypted_att))) + if ((is_watch_only() && !wti.is_income)|| (height > 638000 && !have_type_in_variant_container(decrypted_att))) { remove_field_of_type_from_extra(decrypted_att); remove_field_of_type_from_extra(decrypted_att);