Skip to content

Commit 2c46523

Browse files
committed
go/consensus/cometbft/full: Unify style
1 parent 2a01cbe commit 2c46523

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

go/consensus/cometbft/full/common.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -831,13 +831,14 @@ func (n *commonNode) GetStatus(ctx context.Context) (*consensusAPI.Status, error
831831
valSetHeight = status.GenesisHeight
832832
}
833833
vals, err := n.stateStore.LoadValidators(valSetHeight)
834-
if err != nil {
835-
// Failed to load validator set.
836-
status.IsValidator = false
837-
} else {
834+
switch err {
835+
case nil:
838836
consensusPk := n.identity.ConsensusSigner.Public()
839837
consensusAddr := []byte(crypto.PublicKeyToCometBFT(&consensusPk).Address())
840838
status.IsValidator = vals.HasAddress(consensusAddr)
839+
default:
840+
// Failed to load validator set.
841+
status.IsValidator = false
841842
}
842843
}
843844

0 commit comments

Comments
 (0)