is_out_burned() implemented
This commit is contained in:
parent
fc01b6a099
commit
e2ef29a021
2 changed files with 20 additions and 1 deletions
|
|
@ -405,6 +405,25 @@ namespace currency
|
|||
return stub;
|
||||
}
|
||||
|
||||
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; }
|
||||
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)
|
||||
{
|
||||
return boost::apply_visitor(zz_is_out_burned_helper_visitor(), v);
|
||||
}
|
||||
bool is_out_burned(const txout_target_v& v)
|
||||
{
|
||||
return boost::apply_visitor(zz_is_out_burned_helper_visitor(), v);
|
||||
}
|
||||
|
||||
template<class t_extra_container>
|
||||
bool add_attachments_info_to_extra(t_extra_container& extra_container, const std::vector<attachment_v>& attachments)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace currency
|
|||
{
|
||||
struct tx_source_entry
|
||||
{
|
||||
typedef serializable_pair<txout_ref_v, crypto::public_key> output_entry; // txout_v is either global output index or ref_by_id; public_key - is output ephemeral pub key
|
||||
typedef serializable_pair<txout_ref_v, crypto::public_key> output_entry; // txout_ref_v is either global output index or ref_by_id; public_key - is output's stealth address
|
||||
|
||||
std::vector<output_entry> outputs; //index + key
|
||||
uint64_t real_output; //index in outputs vector of real output_entry
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue