aboutsummaryrefslogtreecommitdiffstats
path: root/eth/downloader/peer.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-06-05 16:53:46 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-06-05 16:53:46 +0800
commit94e4aa6ea9aabb5bf6244d9b38607b336703af98 (patch)
tree3153cbffbfd48c25634f66bb09222f79ba7c640e /eth/downloader/peer.go
parent067e66b34869402cf7bd0f352dad37bd4200e976 (diff)
downloadgo-tangerine-94e4aa6ea9aabb5bf6244d9b38607b336703af98.tar.gz
go-tangerine-94e4aa6ea9aabb5bf6244d9b38607b336703af98.tar.zst
go-tangerine-94e4aa6ea9aabb5bf6244d9b38607b336703af98.zip
eth/downloader: log hard timeouts and reset capacity
Diffstat (limited to 'eth/downloader/peer.go')
-rw-r--r--eth/downloader/peer.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/eth/downloader/peer.go b/eth/downloader/peer.go
index 43b50079b..5fbc64648 100644
--- a/eth/downloader/peer.go
+++ b/eth/downloader/peer.go
@@ -87,6 +87,9 @@ func (p *peer) SetIdle() {
scale := 2.0
if time.Since(p.started) > blockSoftTTL {
scale = 0.5
+ if time.Since(p.started) > blockHardTTL {
+ scale = 1 / float64(MaxBlockFetch) // reduces capacity to 1
+ }
}
for {
// Calculate the new download bandwidth allowance