Skip to content

eth/downloader/fetchers.go

Type MOD
Upstream Lines 67
Changed +3 -0

Add header fetcher dispatch

diff --git a/eth/downloader/fetchers.go b/eth/downloader/fetchers.go
index 6e5c65eb2..4ebb9bbc9 100644
--- a/eth/downloader/fetchers.go
+++ b/eth/downloader/fetchers.go
@@ -45,6 +45,9 @@ func (d *Downloader) fetchHeadersByHash(p *peerConnection, hash common.Hash, amo
    defer timeoutTimer.Stop()

    select {
+   case <-d.cancelCh:
+       return nil, nil, errCanceled
+
    case <-timeoutTimer.C:
        // Header retrieval timed out, update the metrics
        p.log.Debug("Header request timed out", "elapsed", ttl)

← Back to Sync & Downloader