Skip to content

Commit 355f7f7

Browse files
committed
script: add OP_TRUE and OP_FALSE aliases to OPCODES_BY_NAME
These aliases are already defined as module-level constants (OP_FALSE = OP_0, OP_TRUE = OP_1) but were missing from the OPCODES_BY_NAME lookup dict, making it impossible to parse script strings containing these common aliases. Fixes #225
1 parent 91e334d commit 355f7f7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

bitcoin/core/script.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,12 +365,14 @@ def __new__(cls, n):
365365

366366
OPCODES_BY_NAME = {
367367
'OP_0': OP_0,
368+
'OP_FALSE': OP_0,
368369
'OP_PUSHDATA1': OP_PUSHDATA1,
369370
'OP_PUSHDATA2': OP_PUSHDATA2,
370371
'OP_PUSHDATA4': OP_PUSHDATA4,
371372
'OP_1NEGATE': OP_1NEGATE,
372373
'OP_RESERVED': OP_RESERVED,
373374
'OP_1': OP_1,
375+
'OP_TRUE': OP_1,
374376
'OP_2': OP_2,
375377
'OP_3': OP_3,
376378
'OP_4': OP_4,

0 commit comments

Comments
 (0)