aboutsummaryrefslogtreecommitdiffstats
path: root/eth/sync.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-05-10 07:54:06 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-05-10 07:54:06 +0800
commitbd95871a89f7fdc7bd12fc5fc2c99766eb0d7c28 (patch)
tree33a78a81f0caa8a5c1c30aa3286d52796b2faac8 /eth/sync.go
parent45dc690947ebfe9fb3dc64ba3c74fb433b0f474d (diff)
parent05715f27cfd68387f720db115bb8461f8725a341 (diff)
downloadgo-tangerine-bd95871a89f7fdc7bd12fc5fc2c99766eb0d7c28.tar
go-tangerine-bd95871a89f7fdc7bd12fc5fc2c99766eb0d7c28.tar.gz
go-tangerine-bd95871a89f7fdc7bd12fc5fc2c99766eb0d7c28.tar.bz2
go-tangerine-bd95871a89f7fdc7bd12fc5fc2c99766eb0d7c28.tar.lz
go-tangerine-bd95871a89f7fdc7bd12fc5fc2c99766eb0d7c28.tar.xz
go-tangerine-bd95871a89f7fdc7bd12fc5fc2c99766eb0d7c28.tar.zst
go-tangerine-bd95871a89f7fdc7bd12fc5fc2c99766eb0d7c28.zip
Merge pull request #893 from obscuren/develop
eth: added a cancel method for the downloader
Diffstat (limited to 'eth/sync.go')
-rw-r--r--eth/sync.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/eth/sync.go b/eth/sync.go
index c49f5209d..d955eaa50 100644
--- a/eth/sync.go
+++ b/eth/sync.go
@@ -63,6 +63,9 @@ func (pm *ProtocolManager) processBlocks() error {
max := int(math.Min(float64(len(blocks)), float64(blockProcAmount)))
_, err := pm.chainman.InsertChain(blocks[:max])
if err != nil {
+ // cancel download process
+ pm.downloader.Cancel()
+
return err
}
blocks = blocks[max:]