public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Amir Taaki <zgenjix@yahoo.com>
To: "bitcoin-development@lists.sourceforge.net"
	<bitcoin-development@lists.sourceforge.net>
Subject: Re: [Bitcoin-development] script tests - invalid script in script_valid.json?
Date: Sun, 29 Jul 2012 09:42:34 -0700 (PDT)	[thread overview]
Message-ID: <1343580154.34128.YahooMailNeo@web121004.mail.ne1.yahoo.com> (raw)
In-Reply-To: <501565D5.4060608@justmoon.de>

oh, bitcoin...

Thanks justmoon :D



----- Original Message -----
From: Stefan Thomas <moon@justmoon.de>
To: bitcoin-development@lists.sourceforge.net
Cc: 
Sent: Sunday, July 29, 2012 1:33 PM
Subject: Re: [Bitcoin-development] script tests - invalid script in script_valid.json?

OP_WITHIN is lower-bound-inclusive, but upper bound exclusive, so 1 0 1 WITHIN is false.


bool fValue = (bn2 <= bn1 && bn1 < bn3);

https://github.com/bitcoin/bitcoin/blob/master/src/script.cpp#L854

On 7/29/2012 6:31 PM, Amir Taaki wrote:
> Hi!
>
> Is this a valid script?
>
> ["1 0 1", "WITHIN NOT"]
>
> The first value (1) is tested to make sure it is between the lower (0) and upper (1) value. This evaluates to true, placing on the stack a single byte of [01]. NOT then inverses this to a 0 byte false value of [].
>
> What am I missing here?
>
> Thanks
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Bitcoin-development mailing list
Bitcoin-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-development




  reply	other threads:[~2012-07-29 16:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-29 16:31 [Bitcoin-development] script tests - invalid script in script_valid.json? Amir Taaki
2012-07-29 16:33 ` Stefan Thomas
2012-07-29 16:42   ` Amir Taaki [this message]
2012-07-29 17:35     ` Stefan Thomas
2012-07-29 18:48       ` Jeff Garzik
2012-07-30  0:52       ` Gavin Andresen
2012-07-30 14:41         ` Amir Taaki
2012-07-31 14:26         ` Pieter Wuille
2012-07-31 14:39         ` Matt Corallo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1343580154.34128.YahooMailNeo@web121004.mail.ne1.yahoo.com \
    --to=zgenjix@yahoo.com \
    --cc=bitcoin-development@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox