From 50795e578f93a82c958ca36923f7f3f1117a92b8 Mon Sep 17 00:00:00 2001 From: "David A. Harding" Date: Thu, 16 Mar 2023 09:16:55 -1000 Subject: [PATCH] CH07: Remove claim about VERIFY opcodes that doesn't apply to CLTV/CSV Previous text claimed VERIFY opcodes consumed their inputs, but that's not the case for upgraded OP_NOP opcodes. --- chapters/authorization-authentication.adoc | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/chapters/authorization-authentication.adoc b/chapters/authorization-authentication.adoc index 5bb20ab1..603b0088 100644 --- a/chapters/authorization-authentication.adoc +++ b/chapters/authorization-authentication.adoc @@ -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