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`).
This commit is contained in:
Tobin C. Harding 2023-02-10 12:01:23 +11:00
parent 31d254a6a8
commit 657dd51e8b
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 1 additions and 1 deletions

View File

@ -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) }