From 4fc1f8f6b95d56fdf54c4976f73aac5e2687b2d6 Mon Sep 17 00:00:00 2001 From: philip-morlier Date: Thu, 11 Nov 2021 14:41:27 -0800 Subject: [PATCH] GetBockTracer fix --- core/plugin_hooks.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/plugin_hooks.go b/core/plugin_hooks.go index de38dfcfe..0da6e732a 100644 --- a/core/plugin_hooks.go +++ b/core/plugin_hooks.go @@ -260,7 +260,6 @@ func (mt *metaTracer) CaptureExit(output []byte, gasUsed uint64, err error) { func PluginGetBlockTracer(pl *plugins.PluginLoader, hash common.Hash, statedb *state.StateDB) *metaTracer { //look for a function that takes whatever the ctx provides and statedb and returns a core.blocktracer append into meta tracer - log.Info("in pluginGetLiveTracer") tracerList := plugins.Lookup("GetLiveTracer", func(item interface{}) bool { _, ok := item.(func(core.Hash, core.StateDB) core.BlockTracer) log.Info("Item is LiveTracer", "ok", ok, "type", reflect.TypeOf(item)) @@ -280,7 +279,7 @@ func PluginGetBlockTracer(pl *plugins.PluginLoader, hash common.Hash, statedb *s func pluginGetBlockTracer(hash common.Hash, statedb *state.StateDB) *metaTracer { if plugins.DefaultPluginLoader == nil { log.Warn("Attempting GetBlockTracer, but default PluginLoader has not been initialized") - return nil + return &metaTracer{} } return PluginGetBlockTracer(plugins.DefaultPluginLoader, hash, statedb) }