Fix script test handling of empty scripts

Previously an empty script would evaluate to OP_0
This commit is contained in:
Peter Todd
2014-03-12 20:07:51 -04:00
parent ca0b8acbf3
commit b41e594773
3 changed files with 27 additions and 1 deletions

View File

@@ -63,7 +63,11 @@ ParseScript(string s)
BOOST_FOREACH(string w, words)
{
if (all(w, is_digit()) ||
if (w.size() == 0)
{
// Empty string, ignore. (boost::split given '' will return one word)
}
else if (all(w, is_digit()) ||
(starts_with(w, "-") && all(string(w.begin()+1, w.end()), is_digit())))
{
// Number