Use LeafVersion.fromMaskedByte()

This commit is contained in:
Chris Stewart 2025-03-06 15:32:54 -06:00
parent b407141146
commit 63888e8e03

View file

@ -23,10 +23,10 @@ sealed abstract class ControlBlock extends NetworkElement {
}
val leafVersion: LeafVersion =
LeafVersion.fromByte((bytes.head & LeafVersion.TAPROOT_LEAF_MASK).toByte)
LeafVersion.fromMaskedByte(bytes.head)
val isTapLeafMask: Boolean = {
(bytes.head & LeafVersion.TAPROOT_LEAF_MASK).toByte == LeafVersion.Tapscript.toByte
leafVersion == LeafVersion.Tapscript
}
/** Leaf or branch hashes embedded in the control block */