Last active
June 11, 2019 19:02
-
-
Save dangerousfood/b687b42d35761200f977d38bfa426395 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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