Skip to content

Commit

Permalink
txscript/sign: Use calcWitnessSigHashRaw for witness sigs
Browse files Browse the repository at this point in the history
  • Loading branch information
cfromknecht committed Feb 5, 2021
1 parent 97a1f61 commit 1442714
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions txscript/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ func RawTxInWitnessSignature(tx *wire.MsgTx, sigHashes *TxSigHashes, idx int,
amt int64, subScript []byte, hashType SigHashType,
key *btcec.PrivateKey) ([]byte, error) {

parsedScript, err := parseScript(subScript)
if err != nil {
return nil, fmt.Errorf("cannot parse output script: %v", err)
}

hash, err := calcWitnessSignatureHash(parsedScript, sigHashes, hashType, tx,
hash, err := calcWitnessSignatureHashRaw(subScript, sigHashes, hashType, tx,
idx, amt)
if err != nil {
return nil, err
Expand Down

0 comments on commit 1442714

Please sign in to comment.