diff --git a/src/currency_core/currency_format_utils_abstract.h b/src/currency_core/currency_format_utils_abstract.h index 3e5a63fe..b0f915d1 100644 --- a/src/currency_core/currency_format_utils_abstract.h +++ b/src/currency_core/currency_format_utils_abstract.h @@ -200,6 +200,12 @@ namespace currency { try { + if (in_v.type() == typeid(txin_zc_input)) + { + result = boost::get(in_v).k_image; + return true; + } + if (in_v.type() == typeid(txin_to_key)) { result = boost::get(in_v).k_image; @@ -211,12 +217,6 @@ namespace currency result = boost::get(in_v).k_image; return true; } - - if (in_v.type() == typeid(txin_zc_input)) - { - result = boost::get(in_v).k_image; - return true; - } } catch(...) { @@ -229,30 +229,30 @@ namespace currency inline const crypto::key_image& get_key_image_from_txin_v(const txin_v& in_v) { + if (in_v.type() == typeid(txin_zc_input)) + return boost::get(in_v).k_image; + if (in_v.type() == typeid(txin_to_key)) return boost::get(in_v).k_image; if (in_v.type() == typeid(txin_htlc)) return boost::get(in_v).k_image; - if (in_v.type() == typeid(txin_zc_input)) - return boost::get(in_v).k_image; - CHECK_AND_ASSERT_THROW_MES(false, "[get_key_image_from_txin_v] Wrong type: " << in_v.type().name()); } //--------------------------------------------------------------- inline const std::vector& get_key_offsets_from_txin_v(const txin_v& in_v) { + if (in_v.type() == typeid(txin_zc_input)) + return boost::get(in_v).key_offsets; + if (in_v.type() == typeid(txin_to_key)) return boost::get(in_v).key_offsets; if (in_v.type() == typeid(txin_htlc)) return boost::get(in_v).key_offsets; - if (in_v.type() == typeid(txin_zc_input)) - return boost::get(in_v).key_offsets; - CHECK_AND_ASSERT_THROW_MES(false, "[get_key_offsets_from_txin_v] Wrong type: " << in_v.type().name()); } //---------------------------------------------------------------