forked from lthn/blockchain
minor improvements
This commit is contained in:
parent
11ff5a8c62
commit
915d01fa7d
1 changed files with 12 additions and 12 deletions
|
|
@ -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());
|
||||
}
|
||||
//---------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue