Commit d651a376 authored by Jeromy's avatar Jeromy

some cleanup, and fix minor bug in dagreader from previous commit

parent e7dee529
...@@ -288,9 +288,8 @@ func FetchGraph(ctx context.Context, root *Node, serv DAGService) chan struct{} ...@@ -288,9 +288,8 @@ func FetchGraph(ctx context.Context, root *Node, serv DAGService) chan struct{}
} }
// BatchFetch will fill out all of the links of the given Node. // BatchFetch will fill out all of the links of the given Node.
// It returns a channel of indicies, which will be returned in order // It returns a channel of nodes, which the caller can receive
// from 0 to len(root.Links) - 1, signalling that the link specified by // all the child nodes of 'root' on, in proper order.
// the index has been filled out.
func (ds *dagService) BatchFetch(ctx context.Context, root *Node) <-chan *Node { func (ds *dagService) BatchFetch(ctx context.Context, root *Node) <-chan *Node {
sig := make(chan *Node) sig := make(chan *Node)
go func() { go func() {
...@@ -299,7 +298,6 @@ func (ds *dagService) BatchFetch(ctx context.Context, root *Node) <-chan *Node { ...@@ -299,7 +298,6 @@ func (ds *dagService) BatchFetch(ctx context.Context, root *Node) <-chan *Node {
// //
next := 0 next := 0
seen := make(map[int]struct{})
// //
for _, lnk := range root.Links { for _, lnk := range root.Links {
...@@ -314,10 +312,6 @@ func (ds *dagService) BatchFetch(ctx context.Context, root *Node) <-chan *Node { ...@@ -314,10 +312,6 @@ func (ds *dagService) BatchFetch(ctx context.Context, root *Node) <-chan *Node {
continue continue
} }
//
seen[i] = struct{}{}
//
nd, err := Decoded(blk.Data) nd, err := Decoded(blk.Data)
if err != nil { if err != nil {
log.Error("Got back bad block!") log.Error("Got back bad block!")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment