Commit 94e4aa6e authored by Péter Szilágyi's avatar Péter Szilágyi

eth/downloader: log hard timeouts and reset capacity

parent 067e66b3
......@@ -460,6 +460,7 @@ out:
// 3) Amount and availability.
if peer := d.peers.Peer(pid); peer != nil {
peer.Demote()
glog.V(logger.Detail).Infof("%s: block delivery timeout", peer)
}
}
// After removing bad peers make sure we actually have sufficient peer left to keep downloading
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment