txscript/sign: Use calcWitnessSigHashRaw for witness sigs

This commit is contained in:
Conner Fromknecht 2019-04-19 19:10:48 -07:00 committed by Olaoluwa Osuntokun
parent 94e99cf6b7
commit 69f3a39c1c
No known key found for this signature in database
GPG key ID: 3BBD59E99B280306

View file

@ -22,12 +22,7 @@ func RawTxInWitnessSignature(tx *wire.MsgTx, sigHashes *TxSigHashes, idx int,
amt int64, subScript []byte, hashType SigHashType, amt int64, subScript []byte, hashType SigHashType,
key *btcec.PrivateKey) ([]byte, error) { key *btcec.PrivateKey) ([]byte, error) {
parsedScript, err := parseScript(subScript) hash, err := calcWitnessSignatureHashRaw(subScript, sigHashes, hashType, tx,
if err != nil {
return nil, fmt.Errorf("cannot parse output script: %v", err)
}
hash, err := calcWitnessSignatureHash(parsedScript, sigHashes, hashType, tx,
idx, amt) idx, amt)
if err != nil { if err != nil {
return nil, err return nil, err