diff --git a/cmd/exchaind/main.go b/cmd/exchaind/main.go index bc5e5afd68..36735ef08e 100644 --- a/cmd/exchaind/main.go +++ b/cmd/exchaind/main.go @@ -109,6 +109,7 @@ func closeApp(iApp abci.Application) { app := iApp.(*app.OKExChainApp) app.StopStore() evmtypes.CloseIndexer() + evmtypes.CloseTracer() rpc.CloseEthBackend() } diff --git a/x/evm/types/tracer.go b/x/evm/types/tracer.go index 0f600ee0e4..bdb8deb5e0 100644 --- a/x/evm/types/tracer.go +++ b/x/evm/types/tracer.go @@ -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" @@ -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() {