Browse Source

rpc: check error code for broadcast_tx_commit (#7683) (#7688)

(cherry picked from commit 6a02714814)

Co-authored-by: Sam Kleinman <garen@tychoish.com>
pull/7693/head
mergify[bot] 3 years ago
committed by GitHub
parent
commit
47635f756b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      internal/rpc/core/mempool.go

+ 6
- 0
internal/rpc/core/mempool.go View File

@ -72,6 +72,12 @@ func (env *Environment) BroadcastTxCommit(ctx *rpctypes.Context, tx types.Tx) (*
}
r := (<-resCh).GetCheckTx()
if r.Code != abci.CodeTypeOK {
return &coretypes.ResultBroadcastTxCommit{
CheckTx: *r,
Hash: tx.Hash(),
}, fmt.Errorf("transaction encountered error (%s)", r.MempoolError)
}
if !indexer.KVSinkEnabled(env.EventSinks) {
return &coretypes.ResultBroadcastTxCommit{


Loading…
Cancel
Save