Skip to content

Commit

Permalink
Merge PR: fix without gracefully exit (#1197)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangjianmeng authored Nov 16, 2021
1 parent 83a4a00 commit 677cd00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions cmd/exchaind/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ func closeApp(iApp abci.Application) {
app := iApp.(*app.OKExChainApp)
app.StopStore()
evmtypes.CloseIndexer()
evmtypes.CloseTracer()
rpc.CloseEthBackend()
}

Expand Down
11 changes: 4 additions & 7 deletions x/evm/types/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/eth/tracers"
json "github.com/json-iterator/go"
"github.com/okex/exchain/libs/cosmos-sdk/server"
sdk "github.com/okex/exchain/libs/cosmos-sdk/types"
tmtypes "github.com/okex/exchain/libs/tendermint/types"
"github.com/spf13/viper"
Expand Down Expand Up @@ -45,12 +44,10 @@ var (
evmLogConfig *vm.LogConfig
)

func init() {
server.TrapSignal(func() {
if tracesDB != nil {
tracesDB.Close()
}
})
func CloseTracer() {
if tracesDB != nil {
tracesDB.Close()
}
}

func InitTxTraces() {
Expand Down

0 comments on commit 677cd00

Please sign in to comment.