Skip to content

Commit

Permalink
txscript: Rename calcSignatureHashRaw
Browse files Browse the repository at this point in the history
  • Loading branch information
cfromknecht committed Feb 5, 2021
1 parent afa1d5a commit 97a1f61
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions txscript/opcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions txscript/script.go
Original file line number Diff line number Diff line change
Expand Up @@ -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).
//
Expand Down
2 changes: 1 addition & 1 deletion txscript/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 97a1f61

Please sign in to comment.