mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
light: for range
This commit is contained in:
parent
5a37b923fa
commit
7b55bb2dcd
1 changed files with 1 additions and 5 deletions
|
|
@ -294,11 +294,7 @@ func (b *BloomTrieIndexerBackend) fetchMissingNodes(ctx context.Context, section
|
||||||
resCh := make(chan res, types.BloomBitLength)
|
resCh := make(chan res, types.BloomBitLength)
|
||||||
for i := 0; i < 20; i++ {
|
for i := 0; i < 20; i++ {
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for bitIndex := range indexCh {
|
||||||
bitIndex, ok := <-indexCh
|
|
||||||
if !ok {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r := &BloomRequest{BloomTrieRoot: root, BloomTrieNum: section - 1, BitIdx: bitIndex, SectionIdxList: []uint64{section - 1}}
|
r := &BloomRequest{BloomTrieRoot: root, BloomTrieNum: section - 1, BitIdx: bitIndex, SectionIdxList: []uint64{section - 1}}
|
||||||
for {
|
for {
|
||||||
if err := b.odr.Retrieve(ctx, r); err == ErrNoPeers {
|
if err := b.odr.Retrieve(ctx, r); err == ErrNoPeers {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue