Merge pull request #3351 from ipfs/kevina/raw-get-link-opt

merkledag: optimize DagService GetLinks for Raw Nodes.
This commit is contained in:
Jeromy Johnson 2016-11-03 21:23:25 -07:00 committed by GitHub
commit a9df187e56

View File

@ -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