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
core/src/main/scala/org/bitcoins/core/protocol/script
|
@ -99,7 +99,7 @@ object TapscriptControlBlock extends Factory[TapscriptControlBlock] {
|
||||||
internalKey: XOnlyPubKey,
|
internalKey: XOnlyPubKey,
|
||||||
leafHashes: Vector[Sha256Digest]): TapscriptControlBlock = {
|
leafHashes: Vector[Sha256Digest]): TapscriptControlBlock = {
|
||||||
val bytes =
|
val bytes =
|
||||||
(leafVersion.toByte +: internalKey.bytes) ++ ByteVector
|
((leafVersion.toByte | 0x1).toByte +: internalKey.bytes) ++ ByteVector
|
||||||
.concat(leafHashes.map(_.bytes))
|
.concat(leafHashes.map(_.bytes))
|
||||||
TapscriptControlBlock(bytes)
|
TapscriptControlBlock(bytes)
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,8 +18,7 @@ object LeafVersion {
|
||||||
|
|
||||||
case class UnknownLeafVersion(toByte: Byte) extends LeafVersion
|
case class UnknownLeafVersion(toByte: Byte) extends LeafVersion
|
||||||
|
|
||||||
val knownLeafVersions: Vector[LeafVersion] = Vector(
|
val knownLeafVersions: Vector[LeafVersion] = Vector(Tapscript)
|
||||||
Tapscript /*, 0xc1.toByte*/ )
|
|
||||||
|
|
||||||
final val TAPROOT_LEAF_MASK: Byte = 0xfe.toByte
|
final val TAPROOT_LEAF_MASK: Byte = 0xfe.toByte
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue