Browse Source

rpc: check error code for broadcast_tx_commit (#7683)

pull/7686/head
Sam Kleinman 2 years ago
committed by GitHub
parent
commit
6a02714814
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

@ -73,6 +73,12 @@ func (env *Environment) BroadcastTxCommit(ctx context.Context, tx types.Tx) (*co
}
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