diff --git a/cmd/devp2p/crawl.go b/cmd/devp2p/crawl.go index 27755f0d00..92aaad72a3 100644 --- a/cmd/devp2p/crawl.go +++ b/cmd/devp2p/crawl.go @@ -73,10 +73,6 @@ loop: case n := <-c.ch: c.updateNode(n) case it := <-doneCh: - liveIters-- - if liveIters == 0 { - break loop - } if it == c.inputIter { // Enable timeout when we're done revalidating the input nodes. log.Info("Revalidation of input set is done", "len", len(c.input)) @@ -84,6 +80,9 @@ loop: timeoutCh = timeoutTimer.C } } + if liveIters--; liveIters == 0 { + break loop + } case <-timeoutCh: break loop }