mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 14:52:17 +00:00
consensus: don't print shared vars in cs.String()
This commit is contained in:
parent
a1a90fd41f
commit
f44336d57d
@ -268,7 +268,8 @@ func (cs *ConsensusState) SetEventSwitch(evsw *events.EventSwitch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (cs *ConsensusState) String() string {
|
func (cs *ConsensusState) String() string {
|
||||||
return Fmt("ConsensusState(H:%v R:%v S:%v", cs.Height, cs.Round, cs.Step)
|
// better not to access shared variables
|
||||||
|
return Fmt("ConsensusState") //(H:%v R:%v S:%v", cs.Height, cs.Round, cs.Step)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cs *ConsensusState) GetState() *sm.State {
|
func (cs *ConsensusState) GetState() *sm.State {
|
||||||
@ -321,9 +322,7 @@ func (cs *ConsensusState) startRoutines(maxSteps int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (cs *ConsensusState) OnStop() {
|
func (cs *ConsensusState) OnStop() {
|
||||||
cs.mtx.Lock() // NOTE: OnStop prints the cs.Height, which might be concurrently updated ...
|
|
||||||
cs.QuitService.OnStop()
|
cs.QuitService.OnStop()
|
||||||
cs.mtx.Unlock()
|
|
||||||
|
|
||||||
if cs.wal != nil && cs.IsRunning() {
|
if cs.wal != nil && cs.IsRunning() {
|
||||||
cs.wal.Wait()
|
cs.wal.Wait()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user