Skip to content

Commit

Permalink
Merge pull request #3351 from ipfs/kevina/raw-get-link-opt
Browse files Browse the repository at this point in the history
merkledag: optimize DagService GetLinks for Raw Nodes.
  • Loading branch information
whyrusleeping committed Nov 4, 2016
2 parents 1ca2d42 + bfe7ad7 commit a9df187
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions merkledag/merkledag.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ func decodeBlock(b blocks.Block) (node.Node, error) {
}

func (n *dagService) GetLinks(ctx context.Context, c *cid.Cid) ([]*node.Link, error) {
if c.Type() == cid.Raw {
return nil, nil
}
node, err := n.Get(ctx, c)
if err != nil {
return nil, err
Expand Down

0 comments on commit a9df187

Please sign in to comment.