diff --git a/client/broadcast.go b/client/broadcast.go index e21bc080c2..0912de81e8 100644 --- a/client/broadcast.go +++ b/client/broadcast.go @@ -95,23 +95,14 @@ func (ctx Context) BroadcastTxCommit(txBytes []byte) (*sdk.TxResponse, error) { } res, err := node.BroadcastTxCommit(context.Background(), txBytes) - if err != nil { - if errRes := CheckTendermintError(err, txBytes); errRes != nil { - return errRes, nil - } - - return sdk.NewResponseFormatBroadcastTxCommit(res), err - } - - if !res.CheckTx.IsOK() { + if err == nil { return sdk.NewResponseFormatBroadcastTxCommit(res), nil } - if !res.DeliverTx.IsOK() { - return sdk.NewResponseFormatBroadcastTxCommit(res), nil + if errRes := CheckTendermintError(err, txBytes); errRes != nil { + return errRes, nil } - - return sdk.NewResponseFormatBroadcastTxCommit(res), nil + return sdk.NewResponseFormatBroadcastTxCommit(res), err } // BroadcastTxSync broadcasts transaction bytes to a Tendermint node