Bitcoin Forum
May 26, 2024, 02:10:03 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Quick stupid question on OP_NOTIF  (Read 711 times)
luv2drnkbr (OP)
Hero Member
*****
Offline Offline

Activity: 793
Merit: 1016



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: 3402
Merit: 6657


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: 1016



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!