From 94e99cf6b7d572ebe46eebc79d04a4a2cb071001 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Fri, 19 Apr 2019 19:07:18 -0700 Subject: [PATCH] txscript: Rename calcSignatureHashRaw --- txscript/opcode.go | 4 ++-- txscript/script.go | 8 ++++---- txscript/sign.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/txscript/opcode.go b/txscript/opcode.go index 1d8ee25e..9e0320ae 100644 --- a/txscript/opcode.go +++ b/txscript/opcode.go @@ -2065,7 +2065,7 @@ func opcodeCheckSig(op *parsedOpcode, vm *Engine) error { // to sign itself. subScript = removeOpcodeByData(subScript, fullSigBytes) - hash = calcSignatureHashRaw(subScript, hashType, &vm.tx, vm.txIdx) + hash = calcSignatureHash(subScript, hashType, &vm.tx, vm.txIdx) } pubKey, err := btcec.ParsePubKey(pkBytes, btcec.S256()) @@ -2334,7 +2334,7 @@ func opcodeCheckMultiSig(op *parsedOpcode, vm *Engine) error { return err } } else { - hash = calcSignatureHashRaw(script, hashType, &vm.tx, vm.txIdx) + hash = calcSignatureHash(script, hashType, &vm.tx, vm.txIdx) } var valid bool diff --git a/txscript/script.go b/txscript/script.go index 266c36dd..2e3431d0 100644 --- a/txscript/script.go +++ b/txscript/script.go @@ -618,12 +618,12 @@ func CalcSignatureHash(script []byte, hashType SigHashType, tx *wire.MsgTx, idx return nil, err } - return calcSignatureHashRaw(script, hashType, tx, idx), nil + return calcSignatureHash(script, hashType, tx, idx), nil } -// calcSignatureHashRaw computes the signature hash for the specified input of -// the target transaction observing the desired signature hash type. -func calcSignatureHashRaw(sigScript []byte, hashType SigHashType, tx *wire.MsgTx, idx int) []byte { +// calcSignatureHash computes the signature hash for the specified input of the +// target transaction observing the desired signature hash type. +func calcSignatureHash(sigScript []byte, hashType SigHashType, tx *wire.MsgTx, idx int) []byte { // The SigHashSingle signature type signs only the corresponding input // and output (the output with the same index number as the input). // diff --git a/txscript/sign.go b/txscript/sign.go index 4d63a9b2..51c69103 100644 --- a/txscript/sign.go +++ b/txscript/sign.go @@ -285,7 +285,7 @@ sigLoop: // however, assume no sigs etc are in the script since that // would make the transaction nonstandard and thus not // MultiSigTy, so we just need to hash the full thing. - hash := calcSignatureHashRaw(pkScript, hashType, tx, idx) + hash := calcSignatureHash(pkScript, hashType, tx, idx) for _, addr := range addresses { // All multisig addresses should be pubkey addresses