Skip to content

Instantly share code, notes, and snippets.

@dangerousfood
Last active June 11, 2019 19:02
Show Gist options
  • Save dangerousfood/b687b42d35761200f977d38bfa426395 to your computer and use it in GitHub Desktop.
Save dangerousfood/b687b42d35761200f977d38bfa426395 to your computer and use it in GitHub Desktop.
private final List<List<Bytes32>> tree;
private final List<Bytes32> zeroHashes;
private final int height;
private boolean dirty = true;
public MerkleTree(int height) {
assert (height > 1);
this.height = height;
tree = new ArrayList<List<Bytes32>>();
for (int i = 0; i <= height; i++) {
tree.add(new ArrayList<Bytes32>());
}
zeroHashes = generateZeroHashes(height);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment