Fix level when going down & in computeHashes

Fix level when going down & in computeHashes, this affected the methods
Get, GenProof & AddBatch.
This commit is contained in:
2021-08-31 10:38:07 +02:00
parent 61b823d444
commit dff11f4a7f
3 changed files with 63 additions and 3 deletions

4
vt.go
View File

@@ -318,11 +318,11 @@ func (t *vt) computeHashes() ([][2][]byte, error) {
wg.Add(nCPU)
for i := 0; i < nCPU; i++ {
go func(cpu int) {
bucketVT := newVT(t.params.maxLevels-l, t.params.hashFunction)
bucketVT := newVT(t.params.maxLevels, t.params.hashFunction)
bucketVT.params.dbg = newDbgStats()
bucketVT.root = nodesAtL[cpu]
bucketPairs[cpu], err = bucketVT.root.computeHashes(l,
bucketPairs[cpu], err = bucketVT.root.computeHashes(l-1,
t.params.maxLevels, bucketVT.params, bucketPairs[cpu])
if err != nil {
errs[cpu] = err