Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions merkle_tree/merk.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ def get_proof_indices(tree_indices, depth):
for index in maximal_indices:
if index not in redundant_indices:
proof.append(index)
while index > 1:
redundant_indices.add(index)
if (index ^ 1) not in redundant_indices:
break
index //= 2
redundant_indices.add(index)
return [i for i in proof if i-leaf_count not in tree_indices]

def mk_multi_proof(tree, indices):
Expand Down