From 465acb2eec323d2df87c88b170a4dc740dfea262 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 30 May 2017 14:52:08 +0200 Subject: [PATCH] eth/downloader: mark peers idle when state sync is done --- eth/downloader/statesync.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eth/downloader/statesync.go b/eth/downloader/statesync.go index 71ee16e4c6..58e3a33bf4 100644 --- a/eth/downloader/statesync.go +++ b/eth/downloader/statesync.go @@ -85,10 +85,12 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync { finishedReqs []*stateReq timeout = make(chan *stateReq) ) - // Cancel active request timers on exit. defer func() { + // Cancel active request timers on exit. Also set peers to idle so they're + // available for the next sync. for _, req := range activeReqs { req.timer.Stop() + req.peer.SetNodeDataIdle(0) } }() // Run the state sync.