Skip to content

Commit

Permalink
Merge PR: fix incorrectly recover when panic occurred (#2194)
Browse files Browse the repository at this point in the history
  • Loading branch information
KamiD authored Jun 17, 2022
1 parent 93debcc commit ee2975e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions x/evm/txs/tx.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package txs

import (
"math/big"

bam "github.com/okex/exchain/libs/cosmos-sdk/baseapp"
sdk "github.com/okex/exchain/libs/cosmos-sdk/types"
authexported "github.com/okex/exchain/libs/cosmos-sdk/x/auth/exported"
"github.com/okex/exchain/x/evm/txs/base"
"github.com/okex/exchain/x/evm/types"
"math/big"
)

type Tx interface {
Expand Down Expand Up @@ -80,11 +81,11 @@ func TransitionEvmTx(tx Tx, msg *types.MsgEthereumTx) (result *sdk.Result, err e

defer func() {
senderAccount := tx.GetSenderAccount()
tx.RefundFeesWatcher(senderAccount, msg.GetFee(), msg.Data.Price)
if e := recover(); e != nil {
tx.ResetWatcher(senderAccount)
panic(e)
}
tx.RefundFeesWatcher(senderAccount, msg.GetFee(), msg.Data.Price)
tx.FinalizeWatcher(senderAccount, err)
}()

Expand Down

0 comments on commit ee2975e

Please sign in to comment.