From 3185bb8b2208090eee34e25e5fba9236d85f4dac Mon Sep 17 00:00:00 2001 From: Erik Grinaker Date: Tue, 5 Jan 2021 15:45:24 +0100 Subject: [PATCH] blockchain/v0: stop tickers on poolRoutine exit (#5860) Fixes #5841. --- blockchain/v0/reactor.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/blockchain/v0/reactor.go b/blockchain/v0/reactor.go index ac2ef8ece..81fad4932 100644 --- a/blockchain/v0/reactor.go +++ b/blockchain/v0/reactor.go @@ -256,8 +256,13 @@ func (bcR *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) func (bcR *BlockchainReactor) poolRoutine(stateSynced bool) { trySyncTicker := time.NewTicker(trySyncIntervalMS * time.Millisecond) + defer trySyncTicker.Stop() + statusUpdateTicker := time.NewTicker(statusUpdateIntervalSeconds * time.Second) + defer statusUpdateTicker.Stop() + switchToConsensusTicker := time.NewTicker(switchToConsensusIntervalSeconds * time.Second) + defer switchToConsensusTicker.Stop() blocksSynced := uint64(0)