diff --git a/db/substate_iterator.go b/db/substate_iterator.go index 42e1b62..99a145c 100644 --- a/db/substate_iterator.go +++ b/db/substate_iterator.go @@ -105,7 +105,12 @@ func (i *substateIterator) start(numWorkers int) { errCh <- err return } - resultChs[id] <- transaction + select { + case resultChs[id] <- transaction: + case <-i.stopCh: + return + + } } }