Skip to content

rest: fix unreachable provably-unspendable script classification - #246

Open
zloglevel wants to merge 1 commit into
Blockstream:new-indexfrom
zloglevel:fix/provably-unspendable
Open

rest: fix unreachable provably-unspendable script classification#246
zloglevel wants to merge 1 commit into
Blockstream:new-indexfrom
zloglevel:fix/provably-unspendable

Conversation

@zloglevel

Copy link
Copy Markdown

Summary

Fix REST output script classification for provably unspendable scripts.

The existing classification contained two identical is_op_return() branches.

The second branch was unreachable, causing non-OP_RETURN provably unspendable scripts to be reported as unknown.

Changes

  • Replace the unreachable duplicate is_op_return() check with is_provably_unspendable().
  • Preserve the dedicated op_return classification by checking it first.
  • Add regression coverage for:
    • OP_RETURN scripts
    • non-OP_RETURN provably unspendable scripts
    • unknown but potentially spendable scripts
  • Cover both Bitcoin and Liquid builds.

Verification

  • cargo +1.92.0 check --lib
  • cargo +1.92.0 check --lib --features liquid

Signed-off-by: zloglevel <loglevel@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant