From 76339baf6c9407b073828245e3458f4df35190ae Mon Sep 17 00:00:00 2001 From: "Owain G. Ainsworth" Date: Mon, 17 Mar 2014 17:43:40 +0000 Subject: [PATCH] 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. --- script.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script.go b/script.go index 11f0dab3..8c918311 100644 --- a/script.go +++ b/script.go @@ -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) } }