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
1 changed files with 1 additions and 0 deletions

View File

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