Skip to content

Commit c820a7a

Browse files
authored
Merge pull request #899 from evoskuil/master
Use get_spender() vs. get_point() for output/../spender, style.
2 parents 2d5f9ca + e273aab commit c820a7a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/protocols/protocol_explore.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -637,15 +637,16 @@ bool protocol_explore::handle_get_output_spender(const code& ec,
637637
return false;
638638

639639
const auto& query = archive();
640-
const auto spender = query.to_confirmed_spender({ *hash, index });
641-
if (spender.is_terminal())
640+
const chain::point spent{ *hash, index };
641+
const auto link = query.to_confirmed_spender(spent);
642+
if (link.is_terminal())
642643
{
643644
send_not_found();
644645
return true;
645646
}
646647

647-
const auto point = query.get_point(spender);
648-
if (point.hash() == null_hash)
648+
const auto spender = query.get_spender(link);
649+
if (spender.index() == chain::point::null_index)
649650
{
650651
send_internal_server_error(database::error::integrity);
651652
return true;
@@ -655,13 +656,13 @@ bool protocol_explore::handle_get_output_spender(const code& ec,
655656
switch (media)
656657
{
657658
case data:
658-
send_chunk(to_bin(point, size));
659+
send_chunk(to_bin(spender, size));
659660
return true;
660661
case text:
661-
send_text(to_hex(point, size));
662+
send_text(to_hex(spender, size));
662663
return true;
663664
case json:
664-
send_json(value_from(point), two * size);
665+
send_json(value_from(spender), two * size);
665666
return true;
666667
}
667668

0 commit comments

Comments
 (0)