1
0
Fork 0
forked from lthn/blockchain

minor improvements

This commit is contained in:
sowle 2025-05-15 05:38:13 +03:00
parent 11ff5a8c62
commit 915d01fa7d
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -200,6 +200,12 @@ namespace currency
{
try
{
if (in_v.type() == typeid(txin_zc_input))
{
result = boost::get<txin_zc_input>(in_v).k_image;
return true;
}
if (in_v.type() == typeid(txin_to_key))
{
result = boost::get<txin_to_key>(in_v).k_image;
@ -211,12 +217,6 @@ namespace currency
result = boost::get<txin_htlc>(in_v).k_image;
return true;
}
if (in_v.type() == typeid(txin_zc_input))
{
result = boost::get<txin_zc_input>(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<txin_zc_input>(in_v).k_image;
if (in_v.type() == typeid(txin_to_key))
return boost::get<txin_to_key>(in_v).k_image;
if (in_v.type() == typeid(txin_htlc))
return boost::get<txin_htlc>(in_v).k_image;
if (in_v.type() == typeid(txin_zc_input))
return boost::get<txin_zc_input>(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<currency::txout_ref_v>& get_key_offsets_from_txin_v(const txin_v& in_v)
{
if (in_v.type() == typeid(txin_zc_input))
return boost::get<txin_zc_input>(in_v).key_offsets;
if (in_v.type() == typeid(txin_to_key))
return boost::get<txin_to_key>(in_v).key_offsets;
if (in_v.type() == typeid(txin_htlc))
return boost::get<txin_htlc>(in_v).key_offsets;
if (in_v.type() == typeid(txin_zc_input))
return boost::get<txin_zc_input>(in_v).key_offsets;
CHECK_AND_ASSERT_THROW_MES(false, "[get_key_offsets_from_txin_v] Wrong type: " << in_v.type().name());
}
//---------------------------------------------------------------