mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-14 12:06:40 +00:00
eth/downloader: set deliverytime on drops and timeouts too
This commit is contained in:
parent
8f24097836
commit
9fea1a5cf5
1 changed files with 3 additions and 0 deletions
|
|
@ -164,6 +164,7 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync {
|
||||||
// Finalize the request and queue up for processing
|
// Finalize the request and queue up for processing
|
||||||
req.timer.Stop()
|
req.timer.Stop()
|
||||||
req.dropped = true
|
req.dropped = true
|
||||||
|
req.delivered = time.Now()
|
||||||
|
|
||||||
finished = append(finished, req)
|
finished = append(finished, req)
|
||||||
delete(active, p.id)
|
delete(active, p.id)
|
||||||
|
|
@ -176,6 +177,7 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync {
|
||||||
if active[req.peer.id] != req {
|
if active[req.peer.id] != req {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
req.delivered = time.Now()
|
||||||
// Move the timed out data back into the download queue
|
// Move the timed out data back into the download queue
|
||||||
finished = append(finished, req)
|
finished = append(finished, req)
|
||||||
delete(active, req.peer.id)
|
delete(active, req.peer.id)
|
||||||
|
|
@ -193,6 +195,7 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync {
|
||||||
// Move the previous request to the finished set
|
// Move the previous request to the finished set
|
||||||
old.timer.Stop()
|
old.timer.Stop()
|
||||||
old.dropped = true
|
old.dropped = true
|
||||||
|
old.delivered = time.Now()
|
||||||
finished = append(finished, old)
|
finished = append(finished, old)
|
||||||
}
|
}
|
||||||
// Start a timer to notify the sync loop if the peer stalled.
|
// Start a timer to notify the sync loop if the peer stalled.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue