Commit 9b00464f authored by vicotor's avatar vicotor

update code

parent aa990dda
......@@ -90,15 +90,15 @@ func (w workerRegistry) DetailInfo() (json.RawMessage, error) {
info.MinerAddress = w.worker.workerAddr
info.Nonce = int64(w.worker.nonce)
if w.worker.info.deviceInfo != nil {
cpuCount := 0
for i := 0; i < len(w.worker.info.deviceInfo.Devices); i++ {
if strings.HasPrefix(w.worker.info.deviceInfo.Devices[i].DeviceType, "cpu") {
info.CpuModel = w.worker.info.deviceInfo.Devices[i].DeviceModel
cpuCount++
if info.CpuModel == "" {
info.CpuModel = w.worker.info.deviceInfo.Devices[i].DeviceModel
}
info.CpuCore++
}
}
if cpuCount == 0 {
if info.CpuCore == 0 {
info.CpuModel = "Intel(R) Xeon(R) CPU E5-2699 v4 @ 2.20GHz"
info.CpuCore = 8
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment