Skip to content

Commit

Permalink
Make history tree thread-safe
Browse files Browse the repository at this point in the history
  • Loading branch information
aalda committed Feb 25, 2019
1 parent a4d04a9 commit 6741b66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions balloon/history/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (t *HistoryTree) ProveMembership(index, version uint64) (*MembershipProof,
log.Debugf("Proving membership for index %d with version %d", index, version)

// build a visitable pruned tree and then visit it to collect the audit path
visitor := pruning.NewAuditPathVisitor(t.hasher, t.readCache)
visitor := pruning.NewAuditPathVisitor(t.hasherF(), t.readCache)
if index == version {
pruning.PruneToFind(index).Accept(visitor) // faster pruning
} else {
Expand All @@ -79,7 +79,7 @@ func (t *HistoryTree) ProveConsistency(start, end uint64) (*IncrementalProof, er
log.Debugf("Proving consistency between versions %d and %d", start, end)

// build a visitable pruned tree and then visit it to collect the audit path
visitor := pruning.NewAuditPathVisitor(t.hasher, t.readCache)
visitor := pruning.NewAuditPathVisitor(t.hasherF(), t.readCache)
pruning.PruneToCheckConsistency(start, end).Accept(visitor)

proof := NewIncrementalProof(start, end, visitor.Result(), t.hasherF())
Expand Down

0 comments on commit 6741b66

Please sign in to comment.