Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #20 from jenyasd209/fix/visit_all_blocks
Browse files Browse the repository at this point in the history
Visit all blocks
  • Loading branch information
Wondertan committed Oct 12, 2020
2 parents b561ea8 + ac89c02 commit c6d9634
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions ipld/walk.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,19 @@ func Walk(ctx context.Context, id cid.Cid, bs blockstream.BlockStreamer, handler
return err
}

err = wo.handle(nd)
if err != nil {
return err
shouldHandle := true
if nd.Cid().Type() != cid.Raw {
shouldHandle, err = wo.visit(nd.Cid())
if err != nil {
return err
}
}

if shouldHandle {
err = wo.handle(nd)
if err != nil {
return err
}
}

ids := make([]cid.Cid, 0, len(nd.Links()))
Expand Down

0 comments on commit c6d9634

Please sign in to comment.