Bitcoin Forum
November 16, 2024, 10:30:27 AM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Quick stupid question on OP_NOTIF  (Read 712 times)
luv2drnkbr (OP)
Hero Member
*****
Offline Offline

Activity: 793
Merit: 1026



View Profile
August 17, 2016, 10:03:42 AM
 #1

Can OP_NOTIF begin an if/else block?  That is, is the following code valid:

Code:
<true / false stack item>
OP_NOTIF
    <some script to be executed>
OP_ENDIF

Or does an if/else block need to always begin with an OP_IF?

I assume I am correct that you can begin with OP_NOTIF, and that the above script code is valid, but I wanted to double check.

achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3542
Merit: 6886


Just writing some code


View Profile WWW
August 17, 2016, 12:51:23 PM
 #2

That is correct, you can begin the block with OP_NOTIF.

luv2drnkbr (OP)
Hero Member
*****
Offline Offline

Activity: 793
Merit: 1026



View Profile
August 19, 2016, 08:53:49 AM
 #3

Thanks.  It would be cleaner to use OP_IF, but it saves redeemscript space to use NOTIF, and for Bitcoin I figure saving space is the way to go.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!