File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed
Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -304,6 +304,41 @@ typename CLASS::output::cptr CLASS::get_output(
304304 return out.output ;
305305}
306306
307+ TEMPLATE
308+ typename CLASS::point CLASS::get_spent (const output_link& link) const NOEXCEPT
309+ {
310+ // //const auto tx = to_output_tx(link);
311+ // //const auto hash = get_tx_key(tx);
312+ // //const auto index = to_output_index(tx, link);
313+ // //if (tx.is_terminal())
314+ // //{
315+ // // return { {}, 42 };
316+ // //}
317+ // //else if (hash == system::null_hash && index == point::null_index)
318+ // //{
319+ // // return { {}, 96 };
320+ // //}
321+ // //else if (hash == system::null_hash && index != point::null_index)
322+ // //{
323+ // // return { {}, index };
324+ // //}
325+ // //else if (hash != system::null_hash && index == point::null_index)
326+ // //{
327+ // // return { hash, 69 };
328+ // //}
329+ // //else // if (hash != system::null_hash && index != point::null_index)
330+ // //{
331+ // // return { hash, index };
332+ // //}
333+
334+ if (const auto tx = to_output_tx (link); !tx.is_terminal ())
335+ if (const auto index = to_output_index (tx, link);
336+ index != point::null_index)
337+ return { get_tx_key (tx), index };
338+
339+ return {};
340+ }
341+
307342TEMPLATE
308343typename CLASS::point CLASS::get_spender (const point_link& link) const NOEXCEPT
309344{
Original file line number Diff line number Diff line change @@ -394,10 +394,11 @@ class query
394394 input::cptr get_input (const tx_link& link, uint32_t index,
395395 bool witness) const NOEXCEPT;
396396
397+ point get_spent (const output_link& link) const NOEXCEPT;
398+ point get_spender (const point_link& link) const NOEXCEPT;
397399 script::cptr get_output_script (const output_link& link) const NOEXCEPT;
398400 output::cptr get_output (const output_link& link) const NOEXCEPT;
399401 output::cptr get_output (const tx_link& link, uint32_t index) const NOEXCEPT;
400- point get_spender (const point_link& link) const NOEXCEPT;
401402 inputs_ptr get_spenders (const output_link& link,
402403 bool witness) const NOEXCEPT;
403404
You can’t perform that action at this time.
0 commit comments