Bitcoin Forum
March 28, 2023, 08:55:16 AM *
News: Latest Bitcoin Core release: 24.0.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Quick stupid question on OP_NOTIF  (Read 706 times)
luv2drnkbr (OP)
Hero Member
*****
Offline Offline

Activity: 793
Merit: 1007



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.

1679993716
Hero Member
*
Offline Offline

Posts: 1679993716

View Profile Personal Message (Offline)

Ignore
1679993716
Reply with quote  #2

1679993716
Report to moderator
1679993716
Hero Member
*
Offline Offline

Posts: 1679993716

View Profile Personal Message (Offline)

Ignore
1679993716
Reply with quote  #2

1679993716
Report to moderator
1679993716
Hero Member
*
Offline Offline

Posts: 1679993716

View Profile Personal Message (Offline)

Ignore
1679993716
Reply with quote  #2

1679993716
Report to moderator
The grue lurks in the darkest places of the earth. Its favorite diet is adventurers, but its insatiable appetite is tempered by its fear of light. No grue has ever been seen by the light of day, and few have survived its fearsome jaws to tell the tale.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1679993716
Hero Member
*
Offline Offline

Posts: 1679993716

View Profile Personal Message (Offline)

Ignore
1679993716
Reply with quote  #2

1679993716
Report to moderator
1679993716
Hero Member
*
Offline Offline

Posts: 1679993716

View Profile Personal Message (Offline)

Ignore
1679993716
Reply with quote  #2

1679993716
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3024
Merit: 5538


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



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!