Skip to content

Commit

Permalink
txscript: Remove unused removeOpcodeByData func.
Browse files Browse the repository at this point in the history
  • Loading branch information
davecgh authored and cfromknecht committed Feb 5, 2021
1 parent 4091cd0 commit 79d106e
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions txscript/script.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,23 +318,6 @@ func isCanonicalPush(opcode byte, data []byte) bool {
return true
}

// removeOpcodeByData will return the script minus any opcodes that would push
// the passed data to the stack.
//
// DEPRECATED. Use removeOpcodeByDataRaw instead.
func removeOpcodeByData(pkscript []parsedOpcode, data []byte) []parsedOpcode {
retScript := make([]parsedOpcode, 0, len(pkscript))
for _, pop := range pkscript {
if !isCanonicalPush(pop.opcode.value, pop.data) ||
!bytes.Contains(pop.data, data) {

retScript = append(retScript, pop)
}
}
return retScript

}

// removeOpcodeByDataRaw will return the script minus any opcodes that perform a
// canonical push of data that contains the passed data to remove. This
// function assumes it is provided a version 0 script as any future version of
Expand Down

0 comments on commit 79d106e

Please sign in to comment.