mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 14:52:17 +00:00
consensus: fix race from OnStop accessing cs.Height
This commit is contained in:
parent
e4c795f15c
commit
dd788c5631
@ -321,7 +321,10 @@ func (cs *ConsensusState) startRoutines(maxSteps int) {
|
||||
}
|
||||
|
||||
func (cs *ConsensusState) OnStop() {
|
||||
cs.mtx.Lock() // NOTE: OnStop prints the cs.Height, which might be concurrently updated ...
|
||||
cs.QuitService.OnStop()
|
||||
cs.mtx.Unlock()
|
||||
|
||||
if cs.wal != nil && cs.IsRunning() {
|
||||
cs.wal.Wait()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user