From cb1b946b61059a88a32793e1f30a06418b63267a Mon Sep 17 00:00:00 2001 From: zelig Date: Sat, 17 Jan 2015 15:07:18 +0000 Subject: [PATCH] fix bug with Lazy reader node iteration || -> && --- bzz/chunkIO.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bzz/chunkIO.go b/bzz/chunkIO.go index 39043c9f56..e557ca6ac2 100644 --- a/bzz/chunkIO.go +++ b/bzz/chunkIO.go @@ -1,3 +1,4 @@ +// package bzz import ( @@ -231,7 +232,7 @@ func (self *LazyChunkReader) ReadAt(b []byte, off int64) (read int, err error) { var limit int 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 { 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