Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/valid tx execute #173

Merged
merged 4 commits into from
Sep 8, 2023
Merged

Fix/valid tx execute #173

merged 4 commits into from
Sep 8, 2023

Conversation

sirdeggen
Copy link
Contributor

@sirdeggen sirdeggen commented Sep 7, 2023

When subScript is reconstructed it Unparses the parsed script code. The workaround for unformatted data was to stop parsing when we hit the last OpReturn in the script - unfortunately that lead to an incorrect subScript when creating the sighash preimage which means all locking script with checksigs and opreturns at the end would be failing.

The fix is somewhat of a hack - it ensures we parse the unparsable script into a fake op code which contains the buffer of the remainder of the script without checking it for formatting rules otherwise. This allows us to then unparse it into the correct subScript.

One of the tests had to be updated because the expected outcome has changed - we should add a new opcode to the set of parsed opcodes which is "Unformatted Data" - this expectation is now written into the test to reflect the new behavior.

Signed-off-by: Darren Kellenschwiler <[email protected]>
…bytes after the return statement

Signed-off-by: Darren Kellenschwiler <[email protected]>
@mergify mergify bot merged commit 0b3b2ad into master Sep 8, 2023
14 checks passed
@mergify mergify bot deleted the fix/valid-tx-execute branch September 8, 2023 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants