From 9fea1a5cf5a0f833f30a27ca0b60c0d71b71b062 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Fri, 7 Aug 2020 15:31:17 +0200 Subject: [PATCH] eth/downloader: set deliverytime on drops and timeouts too --- eth/downloader/statesync.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eth/downloader/statesync.go b/eth/downloader/statesync.go index 60afcf4311..97b1672dba 100644 --- a/eth/downloader/statesync.go +++ b/eth/downloader/statesync.go @@ -164,6 +164,7 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync { // Finalize the request and queue up for processing req.timer.Stop() req.dropped = true + req.delivered = time.Now() finished = append(finished, req) delete(active, p.id) @@ -176,6 +177,7 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync { if active[req.peer.id] != req { continue } + req.delivered = time.Now() // Move the timed out data back into the download queue finished = append(finished, req) delete(active, req.peer.id) @@ -193,6 +195,7 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync { // Move the previous request to the finished set old.timer.Stop() old.dropped = true + old.delivered = time.Now() finished = append(finished, old) } // Start a timer to notify the sync loop if the peer stalled.