Skip to content

Commit 9fea1a5

Browse files
committed
eth/downloader: set deliverytime on drops and timeouts too
1 parent 8f24097 commit 9fea1a5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

eth/downloader/statesync.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync {
164164
// Finalize the request and queue up for processing
165165
req.timer.Stop()
166166
req.dropped = true
167+
req.delivered = time.Now()
167168

168169
finished = append(finished, req)
169170
delete(active, p.id)
@@ -176,6 +177,7 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync {
176177
if active[req.peer.id] != req {
177178
continue
178179
}
180+
req.delivered = time.Now()
179181
// Move the timed out data back into the download queue
180182
finished = append(finished, req)
181183
delete(active, req.peer.id)
@@ -193,6 +195,7 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync {
193195
// Move the previous request to the finished set
194196
old.timer.Stop()
195197
old.dropped = true
198+
old.delivered = time.Now()
196199
finished = append(finished, old)
197200
}
198201
// Start a timer to notify the sync loop if the peer stalled.

0 commit comments

Comments
 (0)