diff --git a/modules/light-clients/07-tendermint/misbehaviour_handle.go b/modules/light-clients/07-tendermint/misbehaviour_handle.go index 27166e35451..46b962fcabc 100644 --- a/modules/light-clients/07-tendermint/misbehaviour_handle.go +++ b/modules/light-clients/07-tendermint/misbehaviour_handle.go @@ -25,8 +25,7 @@ func (cs ClientState) CheckForMisbehaviour(ctx sdk.Context, cdc codec.BinaryCode // Check if the Client store already has a consensus state for the header's height // If the consensus state exists, and it matches the header then we return early // since header has already been submitted in a previous UpdateClient. - existingConsState, _ := GetConsensusState(clientStore, cdc, tmHeader.GetHeight()) - if existingConsState != nil { + if existingConsState, found := GetConsensusState(clientStore, cdc, tmHeader.GetHeight()); found { // This header has already been submitted and the necessary state is already stored // in client store, thus we can return early without further validation. if reflect.DeepEqual(existingConsState, tmHeader.ConsensusState()) { //nolint:gosimple diff --git a/modules/light-clients/07-tendermint/update.go b/modules/light-clients/07-tendermint/update.go index 5f3c4762c76..c3cd8144ff2 100644 --- a/modules/light-clients/07-tendermint/update.go +++ b/modules/light-clients/07-tendermint/update.go @@ -137,7 +137,7 @@ func (cs ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, client cs.pruneOldestConsensusState(ctx, cdc, clientStore) // check for duplicate update - if consensusState, _ := GetConsensusState(clientStore, cdc, header.GetHeight()); consensusState != nil { + if _, found := GetConsensusState(clientStore, cdc, header.GetHeight()); found { // perform no-op return []exported.Height{header.GetHeight()} }