mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
fix empty tracer config
This commit is contained in:
parent
177074432d
commit
28a80d617f
2 changed files with 8 additions and 4 deletions
|
|
@ -2211,11 +2211,11 @@ func MakeChain(ctx *cli.Context, stack *node.Node, readonly bool) (*core.BlockCh
|
||||||
vmcfg := vm.Config{EnablePreimageRecording: ctx.Bool(VMEnableDebugFlag.Name)}
|
vmcfg := vm.Config{EnablePreimageRecording: ctx.Bool(VMEnableDebugFlag.Name)}
|
||||||
if ctx.IsSet(VMTraceFlag.Name) {
|
if ctx.IsSet(VMTraceFlag.Name) {
|
||||||
if name := ctx.String(VMTraceFlag.Name); name != "" {
|
if name := ctx.String(VMTraceFlag.Name); name != "" {
|
||||||
var config string
|
var config json.RawMessage
|
||||||
if ctx.IsSet(VMTraceConfigFlag.Name) {
|
if ctx.IsSet(VMTraceConfigFlag.Name) {
|
||||||
config = ctx.String(VMTraceConfigFlag.Name)
|
config = json.RawMessage(ctx.String(VMTraceConfigFlag.Name))
|
||||||
}
|
}
|
||||||
t, err := live.Directory.New(name, json.RawMessage(config))
|
t, err := live.Directory.New(name, config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Fatalf("Failed to create tracer %q: %v", name, err)
|
Fatalf("Failed to create tracer %q: %v", name, err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -208,7 +208,11 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if config.VMTrace != "" {
|
if config.VMTrace != "" {
|
||||||
t, err := live.Directory.New(config.VMTrace, json.RawMessage(config.VMTraceConfig))
|
var traceConfig json.RawMessage
|
||||||
|
if config.VMTraceConfig != "" {
|
||||||
|
traceConfig = json.RawMessage(config.VMTraceConfig)
|
||||||
|
}
|
||||||
|
t, err := live.Directory.New(config.VMTrace, traceConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("Failed to create tracer %s: %v", config.VMTrace, err)
|
return nil, fmt.Errorf("Failed to create tracer %s: %v", config.VMTrace, err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue