From 911db90858acff024c54715b5336c95285e695ae Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Wed, 13 Mar 2019 01:13:00 -0500 Subject: [PATCH] txscript: Rename removeOpcodeByDataRaw func. This renames the removeOpcodeByDataRaw to removeOpcodeByData now that the old version has been removed. --- txscript/opcode.go | 4 ++-- txscript/script.go | 4 ++-- txscript/script_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/txscript/opcode.go b/txscript/opcode.go index 950121c6..1d8ee25e 100644 --- a/txscript/opcode.go +++ b/txscript/opcode.go @@ -2063,7 +2063,7 @@ func opcodeCheckSig(op *parsedOpcode, vm *Engine) error { } else { // Remove the signature since there is no way for a signature // to sign itself. - subScript = removeOpcodeByDataRaw(subScript, fullSigBytes) + subScript = removeOpcodeByData(subScript, fullSigBytes) hash = calcSignatureHashRaw(subScript, hashType, &vm.tx, vm.txIdx) } @@ -2236,7 +2236,7 @@ func opcodeCheckMultiSig(op *parsedOpcode, vm *Engine) error { // no way for a signature to sign itself. if !vm.isWitnessVersionActive(0) { for _, sigInfo := range signatures { - script = removeOpcodeByDataRaw(script, sigInfo.signature) + script = removeOpcodeByData(script, sigInfo.signature) } } diff --git a/txscript/script.go b/txscript/script.go index 242fc2d8..266c36dd 100644 --- a/txscript/script.go +++ b/txscript/script.go @@ -318,7 +318,7 @@ func isCanonicalPush(opcode byte, data []byte) bool { return true } -// removeOpcodeByDataRaw will return the script minus any opcodes that perform a +// removeOpcodeByData 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 // script should avoid this functionality since it is unncessary due to the @@ -332,7 +332,7 @@ func isCanonicalPush(opcode byte, data []byte) bool { // NOTE: This function is only valid for version 0 scripts. Since the function // does not accept a script version, the results are undefined for other script // versions. -func removeOpcodeByDataRaw(script []byte, dataToRemove []byte) []byte { +func removeOpcodeByData(script []byte, dataToRemove []byte) []byte { // Avoid work when possible. if len(script) == 0 || len(dataToRemove) == 0 { return script diff --git a/txscript/script_test.go b/txscript/script_test.go index 02c364ce..7db065de 100644 --- a/txscript/script_test.go +++ b/txscript/script_test.go @@ -4136,7 +4136,7 @@ func TestRemoveOpcodeByData(t *testing.T) { return nil, err } - return removeOpcodeByDataRaw(script, data), nil + return removeOpcodeByData(script, data), nil } for _, test := range tests {