eth/downloader: log hard timeouts and reset capacity

This commit is contained in:
Péter Szilágyi
2015-06-05 11:53:46 +03:00
parent 067e66b348
commit 94e4aa6ea9
2 changed files with 4 additions and 0 deletions

View File

@ -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