From 646d46614c2e487b62e9ad4d90460afdc8eab6db Mon Sep 17 00:00:00 2001 From: Balint Gabor Date: Fri, 12 Jan 2018 20:13:30 +0100 Subject: [PATCH] swarm/network: Fix loop variable --- swarm/network/streamer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swarm/network/streamer.go b/swarm/network/streamer.go index 1e78a49adf..40fb038aa8 100644 --- a/swarm/network/streamer.go +++ b/swarm/network/streamer.go @@ -511,10 +511,10 @@ func (self *StreamerPeer) handleOfferedHashesMsg(req *OfferedHashesMsg) error { return err } wg := sync.WaitGroup{} - for i := 0; i < len(hashes)/HashSize; i += HashSize { + for i := 0; i < len(hashes); i += HashSize { hash := hashes[i : i+HashSize] if wait := s.NeedData(hash); wait != nil { - want.Set(i, true) + want.Set(i/HashSize, true) wg.Add(1) // create request and wait until the chunk data arrives and is stored go func(w func()) {