mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-03-15 12:20:06 +01:00
Fix Taproot keyspend serialization (#4443)
This commit is contained in:
parent
93302fea01
commit
5f93096c5a
1 changed files with 6 additions and 1 deletions
|
@ -237,7 +237,12 @@ case class TaprootKeyPath(
|
||||||
hashType: HashType,
|
hashType: HashType,
|
||||||
annexOpt: Option[ByteVector])
|
annexOpt: Option[ByteVector])
|
||||||
extends TaprootWitness {
|
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 {
|
object TaprootKeyPath {
|
||||||
|
|
Loading…
Add table
Reference in a new issue