Resolved invalid proof issue

This commit is contained in:
Harvey Donnelly 2018-07-09 01:16:23 +01:00
parent 0029efd325
commit a5dfe1acf3
2 changed files with 1329 additions and 2 deletions

View File

@ -151,12 +151,13 @@ class MerkleTree {
return []
}
for (let i = 0; i < this.layers.length; i++) {
for (let i = 0; i < this.layers.length -1; i++) {
const layer = this.layers[i]
const isRightNode = index % 2
const pairIndex = (isRightNode ? index - 1 : index + 1)
const pairIndex = (isRightNode ? index - 1 : index)
if (pairIndex < layer.length) {
proof.push({
position: isRightNode ? 'left': 'right',
data: layer[pairIndex]

1326
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff