Added additional locks.

pull/4509/head
frozen 2 years ago committed by Casey Gardiner
parent 0ec4c81121
commit 9328a0aea9
  1. 3
      consensus/consensus_v2.go

@ -436,7 +436,8 @@ func (consensus *Consensus) BlockChannel(newBlock *types.Block) {
consensus.getLogger().Info().Msg("[ConsensusMainLoop] Waiting for Block Time")
time.AfterFunc(time.Until(consensus.NextBlockDue), func() {
consensus.StartFinalityCount()
consensus.mutex.Lock()
defer consensus.mutex.Unlock()
// Update time due for next block
consensus.NextBlockDue = time.Now().Add(consensus.BlockPeriod)

Loading…
Cancel
Save