1
0
Fork 0
forked from lthn/blockchain

get_amount_from_variant() made noexcept

This commit is contained in:
sowle 2022-11-23 19:28:17 +01:00
parent ef38eb9724
commit 928d937a7b
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -815,9 +815,16 @@ namespace currency
uint64_t operator()(const txin_zc_input&) const { return 0; }
uint64_t operator()(const txin_gen& i) const { return 0; }
};
inline uint64_t get_amount_from_variant(const txin_v& v)
inline uint64_t get_amount_from_variant(const txin_v& v) noexcept
{
return boost::apply_visitor(input_amount_getter(), v);
try
{
return boost::apply_visitor(input_amount_getter(), v);
}
catch(...)
{
return 0;
}
}
//---------------------------------------------------------------
struct output_amount_getter : public boost::static_visitor<uint64_t>