diff --git a/consensus/consensus_v2.go b/consensus/consensus_v2.go index 6d68c905e..591fb0dfe 100644 --- a/consensus/consensus_v2.go +++ b/consensus/consensus_v2.go @@ -1085,6 +1085,7 @@ func (consensus *Consensus) Start(blockChannel chan *types.Block, stopChan chan utils.Logger().Info().Time("time", time.Now()).Msg("[ConsensusMainLoop] Consensus started") defer close(stoppedChan) ticker := time.NewTicker(3 * time.Second) + defer ticker.Stop() consensus.consensusTimeout[timeoutBootstrap].Start() utils.Logger().Debug(). Uint64("viewID", consensus.viewID). diff --git a/node/node_handler.go b/node/node_handler.go index 947cbfd00..7d54d52ac 100644 --- a/node/node_handler.go +++ b/node/node_handler.go @@ -479,6 +479,7 @@ func (node *Node) pingMessageHandler(msgPayload []byte, sender libp2p_peer.ID) i // bootstrapConsensus is the a goroutine to check number of peers and start the consensus func (node *Node) bootstrapConsensus() { tick := time.NewTicker(5 * time.Second) + defer tick.Stop() lastPeerNum := node.numPeers for { select {