mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
fix bug with Lazy reader node iteration || -> &&
This commit is contained in:
parent
1b9beaa630
commit
cb1b946b61
1 changed files with 2 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
//
|
||||||
package bzz
|
package bzz
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
@ -231,7 +232,7 @@ func (self *LazyChunkReader) ReadAt(b []byte, off int64) (read int, err error) {
|
||||||
var limit int
|
var limit int
|
||||||
var reader LazySectionReader
|
var reader LazySectionReader
|
||||||
|
|
||||||
for i := index; i < len(self.sections) || want > 0; i++ {
|
for i := index; i < len(self.sections) && want > 0; i++ {
|
||||||
if reader = self.sections[i]; reader == nil {
|
if reader = self.sections[i]; reader == nil {
|
||||||
reader = self.readerFs[i]() // this hooks into the go routines and does a wg.Done once the needed chunks are fetched and processed
|
reader = self.readerFs[i]() // this hooks into the go routines and does a wg.Done once the needed chunks are fetched and processed
|
||||||
self.sections[i] = reader // memoize this reader
|
self.sections[i] = reader // memoize this reader
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue