Skip to content

Commit

Permalink
Merge pull request #3703 from ipfs/fix/format-in-merkledag
Browse files Browse the repository at this point in the history
Fix formatting in merkledag.go
  • Loading branch information
whyrusleeping committed Feb 17, 2017
2 parents 765fb0f + 67a3a67 commit bb35e40
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions merkledag/merkledag.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,12 +399,12 @@ func EnumerateChildrenAsync(ctx context.Context, ds DAGService, c *cid.Cid, visi
done := make(chan struct{})

var setlk sync.Mutex

errChan := make(chan error)
fetchersCtx, cancel := context.WithCancel(ctx)

defer cancel()

for i := 0; i < FetchGraphConcurrency; i++ {
go func() {
for ic := range feed {
Expand All @@ -413,11 +413,11 @@ func EnumerateChildrenAsync(ctx context.Context, ds DAGService, c *cid.Cid, visi
errChan <- err
return
}

setlk.Lock()
unseen := visit(ic)
setlk.Unlock()

if unseen {
select {
case out <- n:
Expand Down Expand Up @@ -466,7 +466,7 @@ func EnumerateChildrenAsync(ctx context.Context, ds DAGService, c *cid.Cid, visi
}
case err := <-errChan:
return err

case <-ctx.Done():
return ctx.Err()
}
Expand Down

0 comments on commit bb35e40

Please sign in to comment.