Skip to content

Commit

Permalink
Make node length definition more clearly
Browse files Browse the repository at this point in the history
  • Loading branch information
exqlnet authored Feb 29, 2024
1 parent e110471 commit 6bc567b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion merkletree.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func NewTree(params ...Parameter) (*MerkleTree, error) {
branchesLen := int(math.Exp2(math.Ceil(math.Log2(float64(len(parameters.data))))))

// We pad our data length up to the power of 2.
nodes := make([][]byte, branchesLen+len(parameters.data)+(branchesLen-len(parameters.data)))
nodes := make([][]byte, branchesLen*2)

// We put the leaves after the branches in the slice of nodes.
createLeaves(
Expand Down

0 comments on commit 6bc567b

Please sign in to comment.