From a76e4495ec1cec3d111d811bb9e4bf4fb0fcbdb0 Mon Sep 17 00:00:00 2001 From: mars Date: Thu, 23 May 2024 20:36:45 +0800 Subject: [PATCH] try to fix 'method handler crashed' for debug_traceCall of #9090 --- turbo/jsonrpc/tracing.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbo/jsonrpc/tracing.go b/turbo/jsonrpc/tracing.go index c891fa25fa4..5a884a01b20 100644 --- a/turbo/jsonrpc/tracing.go +++ b/turbo/jsonrpc/tracing.go @@ -325,7 +325,7 @@ func (api *PrivateDebugAPIImpl) TraceCall(ctx context.Context, args ethapi.CallA } var stateReader state.StateReader - if config.TxIndex == nil || isLatest { + if config == nil || config.TxIndex == nil || isLatest { stateReader, err = rpchelper.CreateStateReader(ctx, dbtx, blockNrOrHash, 0, api.filters, api.stateCache, api.historyV3(dbtx), chainConfig.ChainName) } else { stateReader, err = rpchelper.CreateHistoryStateReader(dbtx, blockNumber, int(*config.TxIndex), api.historyV3(dbtx), chainConfig.ChainName)