From 22f5e45811acd18b2940666524d6959bb06e155a Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Mon, 10 Mar 2014 09:31:48 +0100 Subject: [PATCH] Remove incorrect execution of OP_0. That code was never reached, because OP_0 is not an opcode in terms of chunk.isOpCode()). However, it lead to believe that OP_0 pushes the vector [0], rather than correctly the empty vector to the stack. Because the code was never executed, this bug could never trigger a test. Afaict, script.cpp does not have the corresponding case in its switch block. --- core/src/main/java/com/google/bitcoin/script/Script.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/src/main/java/com/google/bitcoin/script/Script.java b/core/src/main/java/com/google/bitcoin/script/Script.java index 1eb63aa1..657b3abb 100644 --- a/core/src/main/java/com/google/bitcoin/script/Script.java +++ b/core/src/main/java/com/google/bitcoin/script/Script.java @@ -660,10 +660,7 @@ public class Script { continue; switch(opcode) { - case OP_0: - // This is also OP_FALSE (they are both zero). - stack.add(new byte[]{0}); - break; + // OP_0 is no opcode case OP_1NEGATE: stack.add(Utils.reverseBytes(Utils.encodeMPI(BigInteger.ONE.negate(), false))); break;