Commit acd2765e authored by Jeromy's avatar Jeromy

tracking down a bug dhthell found, added asserts and better logging.

parent 0f4376e9
...@@ -101,7 +101,6 @@ func (s *BlockService) GetBlock(ctx context.Context, k u.Key) (*blocks.Block, er ...@@ -101,7 +101,6 @@ func (s *BlockService) GetBlock(ctx context.Context, k u.Key) (*blocks.Block, er
func (s *BlockService) GetBlocks(ctx context.Context, ks []u.Key) <-chan *blocks.Block { func (s *BlockService) GetBlocks(ctx context.Context, ks []u.Key) <-chan *blocks.Block {
out := make(chan *blocks.Block, 32) out := make(chan *blocks.Block, 32)
go func() { go func() {
defer close(out)
var toFetch []u.Key var toFetch []u.Key
for _, k := range ks { for _, k := range ks {
block, err := s.Blockstore.Get(k) block, err := s.Blockstore.Get(k)
...@@ -121,6 +120,7 @@ func (s *BlockService) GetBlocks(ctx context.Context, ks []u.Key) <-chan *blocks ...@@ -121,6 +120,7 @@ func (s *BlockService) GetBlocks(ctx context.Context, ks []u.Key) <-chan *blocks
for blk := range nblocks { for blk := range nblocks {
out <- blk out <- blk
} }
close(out)
}() }()
return out return out
} }
......
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