|
|
|
@ -1111,16 +1111,6 @@ The script with +OP_IF+ does the same thing as using an opcode with a
|
|
|
|
|
So, when do we use +VERIFY+ and when do we use +OP_IF+? If all we are
|
|
|
|
|
trying to do is to attach a precondition (guard clause), then +VERIFY+
|
|
|
|
|
is better. If, however, we want to have more than one execution path
|
|
|
|
|
|
|
|
|
|
[TIP]
|
|
|
|
|
====
|
|
|
|
|
((("EQUAL opcode")))((("opcodes", "EQUAL")))((("EQUALVERIFY
|
|
|
|
|
opcode")))((("opcodes", "EQUALVERIFY")))An opcode such as +EQUAL+ will
|
|
|
|
|
push the result (+TRUE+/+FALSE+) onto the stack, leaving it there for
|
|
|
|
|
evaluation by subsequent opcodes. In contrast, the opcode +EQUALVERIFY+
|
|
|
|
|
suffix does not leave anything on the stack. Opcodes that end in
|
|
|
|
|
+VERIFY+ do not leave the result on the stack.
|
|
|
|
|
====
|
|
|
|
|
(flow control), then we need an +OP_IF...OP_ELSE+ flow control clause.
|
|
|
|
|
|
|
|
|
|
==== Using Flow Control in Scripts
|
|
|
|
|