aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/network/stream/syncer.go
diff options
context:
space:
mode:
Diffstat (limited to 'swarm/network/stream/syncer.go')
-rw-r--r--swarm/network/stream/syncer.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/swarm/network/stream/syncer.go b/swarm/network/stream/syncer.go
index 4fb8b9342..5f03dcff7 100644
--- a/swarm/network/stream/syncer.go
+++ b/swarm/network/stream/syncer.go
@@ -107,6 +107,11 @@ func (s *SwarmSyncerServer) SetNextBatch(from, to uint64) ([]byte, uint64, uint6
metrics.GetOrRegisterCounter("syncer.setnextbatch.iterator", nil).Inc(1)
err := s.store.Iterator(from, to, s.po, func(key storage.Address, idx uint64) bool {
+ select {
+ case <-s.quit:
+ return false
+ default:
+ }
batch = append(batch, key[:]...)
i++
to = idx