Skip to content

Commit 174e743

Browse files
authored
Merge pull request #56 from linwujia/master
Added support for etc currency
2 parents a37f3a4 + a145994 commit 174e743

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Config.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ func (conf *Config) Init() {
132132
switch conf.AgentType {
133133
case "btc":
134134
conf.sessionFactory = new(SessionFactoryBTC)
135+
case "etc":
136+
fallthrough
137+
case "ethw":
138+
fallthrough
139+
case "etf":
140+
fallthrough
135141
case "eth":
136142
conf.sessionFactory = new(SessionFactoryETH)
137143
default:

DownSessionETH.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,14 +386,15 @@ func (down *DownSessionETH) handleRequest() {
386386
return
387387
}
388388
if glog.V(11) {
389-
glog.Info(down.id, "handleRequest: ", string(jsonBytes))
389+
glog.Info(down.id, "handleRequest: ", string(jsonBytes), ", len=", len(jsonBytes), ", hex=", hex.EncodeToString(jsonBytes))
390390
}
391391

392392
rpcData, err := NewJSONRPCLineETH(jsonBytes)
393393

394394
// ignore the json decode error
395395
if err != nil {
396-
glog.Warning(down.id, "failed to decode JSON from miner: ", err.Error(), "; ", string(jsonBytes))
396+
glog.Warning(down.id, "failed to decode JSON from miner: ", err.Error(), "; ", string(jsonBytes), ", len=", len(jsonBytes), ", hex=", hex.EncodeToString(jsonBytes))
397+
continue
397398
}
398399

399400
down.SendEvent(EventRecvJSONRPCETH{rpcData, jsonBytes})

0 commit comments

Comments
 (0)