diff --git a/merkledag/merkledag.go b/merkledag/merkledag.go
index ef66a9f2e84e096e5b0e42dd86b84f7b8d4bf8fa..91062683e35f24d7cc601c17afb6d649462f054d 100644
--- a/merkledag/merkledag.go
+++ b/merkledag/merkledag.go
@@ -308,14 +308,12 @@ func (ds *dagService) GetDAG(ctx context.Context, root *Node) <-chan *Node {
 	sig := make(chan *Node)
 	go func() {
 		var keys []u.Key
-		nodes := make([]*Node, len(root.Links))
-
 		for _, lnk := range root.Links {
 			keys = append(keys, u.Key(lnk.Hash))
 		}
-
 		blkchan := ds.Blocks.GetBlocks(ctx, keys)
 
+		nodes := make([]*Node, len(root.Links))
 		next := 0
 		for blk := range blkchan {
 			i, err := FindLink(root, blk.Key(), nodes)