mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-03-13 11:35:40 +01:00
Fix bug with serializing leaf version
This commit is contained in:
parent
cef0172984
commit
73b06c0067
2 changed files with 2 additions and 3 deletions
|
@ -99,7 +99,7 @@ object TapscriptControlBlock extends Factory[TapscriptControlBlock] {
|
|||
internalKey: XOnlyPubKey,
|
||||
leafHashes: Vector[Sha256Digest]): TapscriptControlBlock = {
|
||||
val bytes =
|
||||
(leafVersion.toByte +: internalKey.bytes) ++ ByteVector
|
||||
((leafVersion.toByte | 0x1).toByte +: internalKey.bytes) ++ ByteVector
|
||||
.concat(leafHashes.map(_.bytes))
|
||||
TapscriptControlBlock(bytes)
|
||||
}
|
||||
|
|
|
@ -18,8 +18,7 @@ object LeafVersion {
|
|||
|
||||
case class UnknownLeafVersion(toByte: Byte) extends LeafVersion
|
||||
|
||||
val knownLeafVersions: Vector[LeafVersion] = Vector(
|
||||
Tapscript /*, 0xc1.toByte*/ )
|
||||
val knownLeafVersions: Vector[LeafVersion] = Vector(Tapscript)
|
||||
|
||||
final val TAPROOT_LEAF_MASK: Byte = 0xfe.toByte
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue