From 87087b8acd523889bde0714c3a8033535fbf47c0 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 23 Jan 2018 21:41:13 -0500 Subject: [PATCH] consensus: minor cosmetic --- consensus/state.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/consensus/state.go b/consensus/state.go index 7b8c8e08f..adf85d081 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -86,7 +86,7 @@ type ConsensusState struct { cstypes.RoundState state sm.State // State until height-1. - // state changes may be triggered by msgs from peers, + // state changes may be triggered by: msgs from peers, // msgs from ourself, or by timeouts peerMsgQueue chan msgInfo internalMsgQueue chan msgInfo @@ -771,11 +771,12 @@ func (cs *ConsensusState) enterPropose(height int64, round int) { return } - if cs.Validators.HasAddress(cs.privValidator.GetAddress()) { - cs.Logger.Debug("This node is a validator") - } else { + // if not a validator, we're done + if !cs.Validators.HasAddress(cs.privValidator.GetAddress()) { cs.Logger.Debug("This node is not a validator") + return } + cs.Logger.Debug("This node is a validator") if cs.isProposer() { cs.Logger.Info("enterPropose: Our turn to propose", "proposer", cs.Validators.GetProposer().Address, "privValidator", cs.privValidator)