Skip to content

Commit

Permalink
Merge PR: fix panic under fast-query mode (#2190)
Browse files Browse the repository at this point in the history
  • Loading branch information
KamiD authored Jun 17, 2022
1 parent ee3ebfa commit 93debcc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ GithubTop=github.com



Version=v1.2.3
Version=v1.2.4
CosmosSDK=v0.39.2
Tendermint=v0.33.9
Iavl=v0.14.3
Expand Down
7 changes: 7 additions & 0 deletions x/evm/txs/deliver/deliver.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package deliver

import (
"fmt"
"math/big"

"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -57,6 +58,12 @@ func (tx *Tx) RefundFeesWatcher(account authexported.Account, coin sdk.Coins, pr
if account == nil || !tx.Keeper.Watcher.Enabled() {
return
}
defer func() {
//panic was not allowed in this function
if e := recover(); e != nil {
tx.Ctx.Logger().Error(fmt.Sprintf("recovered panic at func RefundFeesWatcher %v\n", e))
}
}()
gasConsumed := tx.Ctx.GasMeter().GasConsumed()
fixedFees := refund.CaculateRefundFees(gasConsumed, coin, price)
coins := account.GetCoins().Add2(fixedFees)
Expand Down

0 comments on commit 93debcc

Please sign in to comment.