Alt stack should be purged between scripts.

Found by bitcoind negative scripts.
This commit is contained in:
Owain G. Ainsworth 2014-03-14 17:22:57 +00:00
parent a5e7e9ebb6
commit c7d5102954

View file

@ -628,6 +628,9 @@ func (m *Script) Step() (done bool, err error) {
return false, StackErrMissingEndif
}
// alt stack doesn't persist.
_ = m.astack.DropN(m.astack.Depth())
m.numOps = 0 // number of ops is per script.
m.scriptoff = 0
if m.scriptidx == 0 && m.bip16 {