Merge branch 'trevormil-master'

This commit is contained in:
Miguel Mota 2023-04-24 00:21:06 -07:00
commit 4fc44db033
No known key found for this signature in database
GPG Key ID: 67EC1161588A00F9
1 changed files with 2 additions and 4 deletions

View File

@ -143,12 +143,10 @@ export class MerkleTree extends Base {
}
if (this.fillDefaultHash) {
for (let i = 0; i < Math.pow(2, Math.ceil(Math.log2(this.leaves.length))); i++) {
if (i >= this.leaves.length) {
for (let i = this.leaves.length; i < Math.pow(2, Math.ceil(Math.log2(this.leaves.length))); i++) {
this.leaves.push(this.bufferify(this.fillDefaultHash(i, this.hashFn)))
}
}
}
this.createHashes(this.leaves)
}