提交 e720a6a1 作者: Brian Tiger Chow 提交者: Jeromy

style(merkle): move var dec closer to use

上级 79efd424
...@@ -308,14 +308,12 @@ func (ds *dagService) GetDAG(ctx context.Context, root *Node) <-chan *Node { ...@@ -308,14 +308,12 @@ func (ds *dagService) GetDAG(ctx context.Context, root *Node) <-chan *Node {
sig := make(chan *Node) sig := make(chan *Node)
go func() { go func() {
var keys []u.Key var keys []u.Key
nodes := make([]*Node, len(root.Links))
for _, lnk := range root.Links { for _, lnk := range root.Links {
keys = append(keys, u.Key(lnk.Hash)) keys = append(keys, u.Key(lnk.Hash))
} }
blkchan := ds.Blocks.GetBlocks(ctx, keys) blkchan := ds.Blocks.GetBlocks(ctx, keys)
nodes := make([]*Node, len(root.Links))
next := 0 next := 0
for blk := range blkchan { for blk := range blkchan {
i, err := FindLink(root, blk.Key(), nodes) i, err := FindLink(root, blk.Key(), nodes)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论