les/fetcher : fix requestTimer leak (#26514)

les/fetcher : fix requestTimer leak
This commit is contained in:
ucwong 2023-01-18 02:46:32 -06:00 committed by GitHub
parent 97401b6c63
commit 4a3fb585dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -272,6 +272,7 @@ func (f *lightFetcher) mainloop() {
localHead = f.chain.CurrentHeader()
localTd = f.chain.GetTd(localHead.Hash(), localHead.Number.Uint64())
)
defer requestTimer.Stop()
sub := f.chain.SubscribeChainHeadEvent(headCh)
defer sub.Unsubscribe()