btcsuite / btcd

An alternative full node bitcoin implementation written in Go (golang)
https://github.com/btcsuite/btcd/blob/master/README.md
ISC License
6.1k stars 2.31k forks source link

Make calcWitnessSignatureHashRaw public #2145

Closed cl1ckname closed 3 months ago

cl1ckname commented 3 months ago

Is there any reason why calcWitnessSignatureHashRaw from the txscript package is a private function? A similar function, CalcSignatureHash, for non witness inputs is public and convenient.

If there are no objective reasons for this, I could send a pull request.

Thank you

guggero commented 3 months ago

There are the CalcTapscriptSignaturehash and CalcTaprootSignatureHash functions, with the latter being a direct wrapper around calcWitnessSignatureHashRaw. So I don't think anything needs to be changed.