From 605b996a970942f62a0dc2bd37c85b0774e46436 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Mon, 22 Apr 2024 19:24:30 +0200 Subject: [PATCH] remove txs from mempool when antehandler fails in recheck --- baseapp/baseapp.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 82f47d81b1c..eb72c4709a7 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -911,6 +911,12 @@ func (app *BaseApp) runTx(mode execMode, txBytes []byte) (gInfo sdk.GasInfo, res gasWanted = ctx.GasMeter().Limit() if err != nil { + if mode == execModeReCheck { + // if the ante handler fails on recheck, we want to remove the tx from the mempool + if err := app.mempool.Remove(tx); err != nil { + return gInfo, nil, anteEvents, errors.Join(err, err) + } + } return gInfo, nil, nil, err }