From fda067be655a9ad2f631c038927979a4956534be Mon Sep 17 00:00:00 2001 From: rain <206131521@qq.com> Date: Fri, 24 Sep 2021 11:41:37 +0800 Subject: [PATCH] check fee polyproxy check --- http/mysql.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/http/mysql.go b/http/mysql.go index f6cce512..c0d26192 100644 --- a/http/mysql.go +++ b/http/mysql.go @@ -19,6 +19,7 @@ package http import ( "fmt" + "github.com/beego/beego/v2/core/logs" "poly-bridge/basedef" "poly-bridge/conf" "strings" @@ -45,9 +46,15 @@ func Init() { panic(err) } + proxyMap := make(map[string]bool, 0) proxyConfigs := conf.GlobalConfig.ChainListenConfig for _, v := range proxyConfigs { - polyProxy[strings.ToUpper(v.ProxyContract)] = true - polyProxy[strings.ToUpper(basedef.HexStringReverse(v.ProxyContract))] = true + proxyMap[strings.ToUpper(v.ProxyContract)] = true + proxyMap[strings.ToUpper(basedef.HexStringReverse(v.ProxyContract))] = true } + polyProxy = proxyMap + if len(polyProxy) == 0 { + panic("http init polyProxy err,polyProxy is nil") + } + logs.Info("http init polyProxy:", polyProxy) }