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

CScript.witness_version() should call CSriptOp.decode_op_n() on the value before returning #298

Open
dgpv opened this issue Jan 19, 2024 · 0 comments
Assignees

Comments

@dgpv
Copy link
Contributor

dgpv commented Jan 19, 2024

def witness_version(self):
"""Returns the witness version on [0,16]. """
return next(iter(self))

Because the witness version is actually a 'small int' opcode - that is, for witness version 1, without decode_op_n(), the returned value will be 0x51. It worked for version 0 because 'small int' opcode is decoded as 0 --> 0; 0x51..0x60 --> 1..16

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

No branches or pull requests

2 participants