Fix Taproot keyspend serialization (#4443)

This commit is contained in:
benthecarman 2022-07-02 05:05:36 -05:00 committed by GitHub
parent 93302fea01
commit 5f93096c5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -237,7 +237,12 @@ case class TaprootKeyPath(
hashType: HashType,
annexOpt: Option[ByteVector])
extends TaprootWitness {
override val stack: Vector[ByteVector] = Vector(signature.bytes)
override val stack: Vector[ByteVector] = {
if (hashType == HashType.sigHashDefault) {
Vector(signature.bytes)
} else Vector(signature.bytes :+ hashType.byte)
}
}
object TaprootKeyPath {