add missing lock

pull/3447/head
Rongjian Lan 4 years ago
parent fa2ab7406b
commit 6d837e5cfe
  1. 2
      consensus/leader.go

@ -308,6 +308,8 @@ func (consensus *Consensus) onCommit(msg *msg_pb.Message) {
time.Sleep(1000 * time.Millisecond)
logger.Info().Msg("[OnCommit] Commit Grace Period Ended")
consensus.mutex.Lock()
defer consensus.mutex.Unlock()
if viewID == consensus.GetCurBlockViewID() {
consensus.finalCommit()
}

Loading…
Cancel
Save