From a1459946ce55d1b08a4132acc4059fb234fe828b Mon Sep 17 00:00:00 2001 From: linwj Date: Thu, 15 Sep 2022 11:30:19 +0800 Subject: [PATCH] Added support for etc currency --- Config.go | 6 ++++++ DownSessionETH.go | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Config.go b/Config.go index 7bae66c..1e58a93 100644 --- a/Config.go +++ b/Config.go @@ -132,6 +132,12 @@ func (conf *Config) Init() { switch conf.AgentType { case "btc": conf.sessionFactory = new(SessionFactoryBTC) + case "etc": + fallthrough + case "ethw": + fallthrough + case "etf": + fallthrough case "eth": conf.sessionFactory = new(SessionFactoryETH) default: diff --git a/DownSessionETH.go b/DownSessionETH.go index ee72cd2..803e5e2 100644 --- a/DownSessionETH.go +++ b/DownSessionETH.go @@ -386,14 +386,15 @@ func (down *DownSessionETH) handleRequest() { return } if glog.V(11) { - glog.Info(down.id, "handleRequest: ", string(jsonBytes)) + glog.Info(down.id, "handleRequest: ", string(jsonBytes), ", len=", len(jsonBytes), ", hex=", hex.EncodeToString(jsonBytes)) } rpcData, err := NewJSONRPCLineETH(jsonBytes) // ignore the json decode error if err != nil { - glog.Warning(down.id, "failed to decode JSON from miner: ", err.Error(), "; ", string(jsonBytes)) + glog.Warning(down.id, "failed to decode JSON from miner: ", err.Error(), "; ", string(jsonBytes), ", len=", len(jsonBytes), ", hex=", hex.EncodeToString(jsonBytes)) + continue } down.SendEvent(EventRecvJSONRPCETH{rpcData, jsonBytes})