1
0
Fork 0
forked from lthn/blockchain

inline for is_out_burned

This commit is contained in:
sowle 2022-07-06 15:54:51 +02:00
parent 9b2c951d71
commit e18f300fae
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -406,20 +406,20 @@ namespace currency
}
template<typename out_t>
bool is_out_burned(const out_t& out) { CHECK_AND_ASSERT_THROW_MES(false, "incorrect out type: " << typeid(out).name()); }
bool is_out_burned(const tx_out_bare& o) { return is_out_burned(o.target); }
bool is_out_burned(const txout_to_key& o) { return o.key == null_pkey; }
bool is_out_burned(const tx_out_zarcanum& o) { return o.stealth_address == null_pkey; }
inline bool is_out_burned(const out_t& out) { CHECK_AND_ASSERT_THROW_MES(false, "incorrect out type: " << typeid(out).name()); }
inline bool is_out_burned(const tx_out_bare& o) { return is_out_burned(o.target); }
inline bool is_out_burned(const txout_to_key& o) { return o.key == null_pkey; }
inline bool is_out_burned(const tx_out_zarcanum& o) { return o.stealth_address == null_pkey; }
struct zz_is_out_burned_helper_visitor : boost::static_visitor<bool>
{
template<typename T>
bool operator()(const T& v) const { return is_out_burned(v); }
};
bool is_out_burned(const tx_out_v& v)
inline bool is_out_burned(const tx_out_v& v)
{
return boost::apply_visitor(zz_is_out_burned_helper_visitor(), v);
}
bool is_out_burned(const txout_target_v& v)
inline bool is_out_burned(const txout_target_v& v)
{
return boost::apply_visitor(zz_is_out_burned_helper_visitor(), v);
}