fix: handle invalid script data after OP_RETURN in DecodeScript#96
Merged
mergify[bot] merged 1 commit intomasterfrom Feb 20, 2026
Merged
fix: handle invalid script data after OP_RETURN in DecodeScript#96mergify[bot] merged 1 commit intomasterfrom
mergify[bot] merged 1 commit intomasterfrom
Conversation
Contributor
|
Welcome to our open-source project! 💘 |
82d1b63 to
f45dc30
Compare
rohenaz
approved these changes
Feb 20, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #96 +/- ##
=======================================
Coverage 75.60% 75.60%
=======================================
Files 3 3
Lines 287 287
=======================================
Hits 217 217
Misses 51 51
Partials 19 19
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
This was referenced Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DecodeOptionsParseOpReturntoscript.DecodeScriptinxput.goso OP_RETURN data is parsed correctlynilinstead of propagating error whenDecodeScriptfails on unparseable output scripts (e.g. sCrypt contracts, non-standard OP_RETURN data)DecodeOptionsParseOpReturn)Problem
Transaction
471442b27852e6a1a83e2f2bec8c1712ad3721534f2e35fda89b853471e7898fcrashes the parsing pipeline. It contains an sCrypt contract output and a non-standard OP_RETURN output with invalid push data encoding. WithoutDecodeOptionsParseOpReturn,DecodeScriptdoesn't attempt to parse OP_RETURN data at all. With it enabled, when the post-OP_RETURN bytes can't be decoded, we now return nil so that: