miner info feature temporarily disabled

This commit is contained in:
8lecramm 2022-09-20 01:25:56 +02:00 committed by GitHub
parent 3ba55712a7
commit efc773ca51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 23 deletions

View File

@ -79,7 +79,7 @@ func main() {
time.Sleep(time.Second * 1) time.Sleep(time.Second * 1)
} }
go proxy.Start_client(proxy.Address) go proxy.Start_client(proxy.Address)
go proxy.SendUpdateToDaemon() //go proxy.SendUpdateToDaemon()
for { for {
time.Sleep(time.Second * time.Duration(config.Log_intervall)) time.Sleep(time.Second * time.Duration(config.Log_intervall))

View File

@ -5,7 +5,6 @@ import (
"crypto/elliptic" "crypto/elliptic"
"crypto/rand" "crypto/rand"
"crypto/x509" "crypto/x509"
"encoding/json"
"encoding/pem" "encoding/pem"
"fmt" "fmt"
"math/big" "math/big"
@ -196,32 +195,34 @@ func newUpgrader() *websocket.Upgrader {
client_list_mutex.Lock() client_list_mutex.Lock()
defer client_list_mutex.Unlock() defer client_list_mutex.Unlock()
var x MinerInfo_Params /*
if json.Unmarshal(data, &x); len(x.Wallet_Address) > 0 { var x MinerInfo_Params
if json.Unmarshal(data, &x); len(x.Wallet_Address) > 0 {
if x.Miner_Hashrate > 0 { if x.Miner_Hashrate > 0 {
sess := client_list[c] sess := client_list[c]
sess.hashrate = x.Miner_Hashrate sess.hashrate = x.Miner_Hashrate
client_list[c] = sess client_list[c] = sess
} }
var NewHashRate float64 var NewHashRate float64
for _, s := range client_list { for _, s := range client_list {
NewHashRate += s.hashrate NewHashRate += s.hashrate
} }
Hashrate = NewHashRate Hashrate = NewHashRate
// Update miners information // Update miners information
return return
} else {
SendToDaemon(data)
if !config.Pool_mode {
fmt.Printf("%v Submitting result from miner: %v, Wallet: %v\n", time.Now().Format(time.Stamp), c.RemoteAddr().String(), client_list[c].address.String())
} else { } else {
shares++ */
fmt.Printf("%v Shares submitted: %d\n", time.Now().Format(time.Stamp), shares) SendToDaemon(data)
} if !config.Pool_mode {
fmt.Printf("%v Submitting result from miner: %v, Wallet: %v\n", time.Now().Format(time.Stamp), c.RemoteAddr().String(), client_list[c].address.String())
} else {
shares++
fmt.Printf("%v Shares submitted: %d\n", time.Now().Format(time.Stamp), shares)
} }
//}
}) })
u.OnClose(func(c *websocket.Conn, err error) { u.OnClose(func(c *websocket.Conn, err error) {