Skip to content

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

Description

@dgpv

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions