From 657dd51e8bfeb0606c53889d6d4a10ed38446a5d Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 10 Feb 2023 12:01:23 +1100 Subject: [PATCH] Use OP_0 to better mimic bitcoin core code Our `Builder::push_int` method is the same as Bitcoin Core `CScript` `push_int64` method. We currently use `OP_FALSE` (equivalent to `OP_0`) but recently we added `OP_0`, lets use it to make our code better mimic Core (also saves devs checking that `OP_FALSE` is the same as `OP_0`). --- bitcoin/src/blockdata/script/builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitcoin/src/blockdata/script/builder.rs b/bitcoin/src/blockdata/script/builder.rs index a69b19eb..158b7e28 100644 --- a/bitcoin/src/blockdata/script/builder.rs +++ b/bitcoin/src/blockdata/script/builder.rs @@ -42,7 +42,7 @@ impl Builder { } // We can also special-case zero else if data == 0 { - self.push_opcode(opcodes::OP_FALSE) + self.push_opcode(opcodes::OP_0) } // Otherwise encode it as data else { self.push_int_non_minimal(data) }