chia-blockchain/chia/wallet/puzzles/sha256tree_module.clvm

15 lines
307 B
Plaintext

(
mod (program)
;; hash a tree
;; This is used to calculate a puzzle hash given a puzzle program.
(defun sha256tree
(TREE)
(if (l TREE)
(sha256 2 (sha256tree (f TREE)) (sha256tree (r TREE)))
(sha256 1 TREE)
)
)
(sha256tree program)
)