Skip to content

Commit daa8b79

Browse files
committed
Make OP_EQUAL put correct b'' value on stack
This mistake is caught by Bitcoin Core's test cases; the other two cases are currently not, so instead we have FIXME's as we need to write those new test cases.
1 parent 43530c8 commit daa8b79

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bitcoin/core/scripteval.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,8 @@ def check_args(n):
484484
if sop != OP_CHECKSIGVERIFY:
485485
stack.append(b"\x01")
486486
else:
487+
# FIXME: this is incorrect, but not caught by existing
488+
# test cases
487489
stack.append(b"\x00")
488490

489491
elif sop == OP_CODESEPARATOR:
@@ -520,7 +522,7 @@ def check_args(n):
520522
if v1 == v2:
521523
stack.append(b"\x01")
522524
else:
523-
stack.append(b"\x00")
525+
stack.append(b"")
524526

525527
elif sop == OP_EQUALVERIFY:
526528
check_args(2)
@@ -657,6 +659,8 @@ def check_args(n):
657659
if v:
658660
stack.append(b"\x01")
659661
else:
662+
# FIXME: this is incorrect, but not caught by existing
663+
# test cases
660664
stack.append(b"\x00")
661665

662666
else:

0 commit comments

Comments
 (0)