From aee0d470b160c1536c76ce26ddf6413e7d502d4e Mon Sep 17 00:00:00 2001 From: philip-morlier Date: Mon, 20 Feb 2023 10:00:30 -0800 Subject: [PATCH] added warn message to setTrieFlushIntervalClone hook --- core/plugin_hooks.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/plugin_hooks.go b/core/plugin_hooks.go index 0786761cf..a8f1bee0c 100644 --- a/core/plugin_hooks.go +++ b/core/plugin_hooks.go @@ -5,6 +5,7 @@ import ( "math/big" "reflect" "time" + "sync" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/state" @@ -303,10 +304,13 @@ func PluginSetTrieFlushIntervalClone(pl *plugins.PluginLoader, flushInterval tim _, ok := item.(func(time.Duration) time.Duration) return ok }) + var snc sync.Once + if len(fnList) > 0 { + snc.Do(func() {log.Warn("The blockChain flushInterval value is being accessed by multiple plugins")}) + } for _, fni := range fnList { - log.Error("len fn list", "len", len(fnList)) if fn, ok := fni.(func(time.Duration) time.Duration); ok { - return fn(flushInterval) + flushInterval = fn(flushInterval) } } return flushInterval