From aedc910c844d79713f5e544a211ceabf4372c687 Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Wed, 4 May 2016 17:24:19 -0400 Subject: Comments cleanup, remove some more useless code --- merkle.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'merkle.go') diff --git a/merkle.go b/merkle.go index 15294bd..ccb348c 100644 --- a/merkle.go +++ b/merkle.go @@ -30,9 +30,9 @@ func NewMerkle(mtype string, height int64, fname string) Merkle { // nodes are stored in BFS order, root node first type BFSMerkle struct { - height int64 + height int64 // root counts as height 1, children of root as height 2, etc. *os.File - size int64 + size int64 // maximum label of node = 2^height -2 } func NewBFSMerkle(height int64, fname string) *BFSMerkle { @@ -187,9 +187,9 @@ func (m *PostMerkle) Proof(id int64) [][]byte { if mask&id > 0 { // leaf is in the right subtree of current node m.ReadAt(proof[i], (cur-size)*hashSize) // reading the left child cur -= 1 // moving to the right subtree - } else { // left is in the left subtree of current node + } else { // leaf is in the left subtree of current node m.ReadAt(proof[i], (cur-1)*hashSize) // reading the right child - cur -= size // moving the left subtree + cur -= size // moving to the left subtree } size = mask mask >>= 1 -- cgit v1.2.3-70-g09d2