Make removeOpcodeByData in line with bitcoind behaviour.

It should remove the opcode and data is the data is contained within the data
pushed, not just if it is equal to it. Found by bitcoind tx tests.
This commit is contained in:
Owain G. Ainsworth 2014-03-17 17:43:40 +00:00
parent dab2a7cb0f
commit 76339baf6c

View file

@ -754,7 +754,7 @@ func removeOpcode(pkscript []parsedOpcode, opcode byte) []parsedOpcode {
func removeOpcodeByData(pkscript []parsedOpcode, data []byte) []parsedOpcode {
retScript := make([]parsedOpcode, 0, len(pkscript))
for _, pop := range pkscript {
if !bytes.Equal(pop.data, data) {
if !bytes.Contains(pop.data, data) {
retScript = append(retScript, pop)
}
}