Skip to content

Commit

Permalink
Merge pull request #56 from linwujia/master
Browse files Browse the repository at this point in the history
Added support for etc currency
  • Loading branch information
linwujia authored Sep 15, 2022
2 parents a37f3a4 + a145994 commit 174e743
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions Config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions DownSessionETH.go
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down

0 comments on commit 174e743

Please sign in to comment.