Skip to content

Commit

Permalink
remove txs from mempool when antehandler fails in recheck
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed Apr 22, 2024
1 parent e59ca15 commit 605b996
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 605b996

Please sign in to comment.