Skip to content

Commit

Permalink
Added support for etc currency
Browse files Browse the repository at this point in the history
  • Loading branch information
linwj committed Sep 15, 2022
1 parent a37f3a4 commit a145994
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 a145994

Please sign in to comment.