[project] Fix two leaking tickers (#1821)

pull/1822/head
Edgar Aroutiounian 5 years ago committed by GitHub
parent a8163205d1
commit 381a7bd02d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      consensus/consensus_v2.go
  2. 1
      node/node_handler.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).

@ -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 {

Loading…
Cancel
Save