From 7b55bb2dcd102f9ea06c83566bead4444fe7922a Mon Sep 17 00:00:00 2001 From: Zsolt Felfoldi Date: Wed, 15 Aug 2018 21:14:35 +0200 Subject: [PATCH] light: for range --- light/postprocess.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/light/postprocess.go b/light/postprocess.go index e7af7282a2..0b25e1d881 100644 --- a/light/postprocess.go +++ b/light/postprocess.go @@ -294,11 +294,7 @@ func (b *BloomTrieIndexerBackend) fetchMissingNodes(ctx context.Context, section resCh := make(chan res, types.BloomBitLength) for i := 0; i < 20; i++ { go func() { - for { - bitIndex, ok := <-indexCh - if !ok { - return - } + for bitIndex := range indexCh { r := &BloomRequest{BloomTrieRoot: root, BloomTrieNum: section - 1, BitIdx: bitIndex, SectionIdxList: []uint64{section - 1}} for { if err := b.odr.Retrieve(ctx, r); err == ErrNoPeers {