rpc: check error code for broadcast_tx_commit (#7683)

This commit is contained in:
Sam Kleinman
2022-01-25 13:35:03 -05:00
committed by GitHub
parent 5db7a7d6db
commit 6a02714814

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{