Commit graph

8 commits

Author SHA1 Message Date
Owain G. Ainsworth
7e937fae75 testing for the case where a p2sh sigscript isn't pushonly.
Also providing a defined error (from NewScript) for that case.
2013-06-25 13:12:15 +01:00
Owain G. Ainsworth
53ba8fb834 gofmt 2013-06-21 01:33:56 +01:00
Owain G. Ainsworth
03696a8874 Add functions to count the number of signature operations in a script.
To be usd for validation. Most of the codepaths teste, a few tests
missing for cases needed tests in the validation codepaths too. To be
worked on in tree.
2013-06-20 20:10:30 +01:00
Owain G. Ainsworth
421a213a4f Stop modifying the passed tx in NewScript.
The only time we need to zero out scripts is for calcScriptHash which operates
on a deep copy anyway. This should make the tx passed to us unmodified now.
2013-06-20 20:10:05 +01:00
Owain G. Ainsworth
df0c0b27d1 Factor the end-of-script error handling into a function.
Use it to reduce code dpulication in the bip16 case.

In addition we export it so that that a user could run:
for !done && err == nil {
	done, err = s.Step()
}
err = s.CheckErrorCondition()

manually instead of having to run Execute().
2013-06-18 17:44:29 +01:00
Owain G. Ainsworth
7b08a4e127 Number of operations is per-script not per-transaction.
Reset the counter at the end of each script.
2013-06-18 17:44:18 +01:00
Owain G. Ainsworth
bc41004b03 Use errors.New() not fmt.Errorf() when no fmt string. 2013-06-18 17:44:15 +01:00
Dave Collins
1197770159 Initial implementation. 2013-06-13 14:59:46 -05:00