bip360: mask tapleaf_version in tapleaf_hash

This commit is contained in:
notmike committed 2026-06-27 22:40:15 -06:00
1 parent 94b0f9db4c
commit 75167ec077
1 file changed
+1 -1
+1 -1
View File
@@ -79,7 +79,7 @@ def tapleaf_hash(script: bytes, tapleaf_ver: int = 0xc0) -> bytes:
"""Hash function for tree leaves"""
if not script:
raise ValueError("tapleaf_hash: script is required")
leaf = bytes([tapleaf_ver]) + serialize_varbytes(script)
leaf = bytes([tapleaf_ver & 0xfe]) + serialize_varbytes(script)
return tagged_hash("TapLeaf", leaf)