mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
eth/downloader: mark peers idle when state sync is done
This commit is contained in:
parent
ac085e02a2
commit
465acb2eec
1 changed files with 3 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue