Initial commit of stand alone consensus engine work.
This commit is contained in:
+2
-1
@@ -355,8 +355,9 @@ func geth(ctx *cli.Context) error {
|
||||
defer stack.Close()
|
||||
defer pluginsOnShutdown()
|
||||
stack.RegisterAPIs(pluginGetAPIs(stack, wrapperBackend))
|
||||
//end PluGeth code injection
|
||||
startNode(ctx, stack, backend, false)
|
||||
pluginHookTester()
|
||||
//end PluGeth code injection
|
||||
stack.Wait()
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -102,3 +102,21 @@ func pluginsOnShutdown() {
|
||||
}
|
||||
OnShutdown(plugins.DefaultPluginLoader)
|
||||
}
|
||||
|
||||
func HookTester(pl *plugins.PluginLoader) {
|
||||
fnList := pl.Lookup("HookTester", func(item interface{}) bool {
|
||||
_, ok := item.(func())
|
||||
return ok
|
||||
})
|
||||
for _, fni := range fnList {
|
||||
fni.(func())()
|
||||
}
|
||||
}
|
||||
|
||||
func pluginHookTester() {
|
||||
if plugins.DefaultPluginLoader == nil {
|
||||
log.Warn("Attempting HookTester, but default PluginLoader has not been initialized")
|
||||
return
|
||||
}
|
||||
HookTester(plugins.DefaultPluginLoader)
|
||||
}
|
||||
Reference in New Issue
Block a user