random nonce function at right place now
This commit is contained in:
parent
7d67f1b17d
commit
5c71cdc81e
@ -20,7 +20,6 @@ var connection *websocket.Conn
|
||||
// proxy-client
|
||||
func Start_client(v string, w string) {
|
||||
var err error
|
||||
var rand_nonce []byte
|
||||
|
||||
rand.Seed(time.Now().UnixMilli())
|
||||
|
||||
@ -49,15 +48,10 @@ func Start_client(v string, w string) {
|
||||
|
||||
if msg_type != websocket.TextMessage {
|
||||
continue
|
||||
} else {
|
||||
if rand_nonce = edit_blob(recv_data); rand_nonce != nil {
|
||||
go SendTemplatesToNode(rand_nonce)
|
||||
} else {
|
||||
go SendTemplatesToNode(recv_data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
go SendTemplatesToNode(recv_data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -95,6 +95,7 @@ func CountMiners() int {
|
||||
|
||||
// forward all incoming templates from daemon to all miners
|
||||
func SendTemplatesToNode(data []byte) {
|
||||
var rand_nonce []byte
|
||||
|
||||
for rk, rv := range client_list {
|
||||
|
||||
@ -102,6 +103,10 @@ func SendTemplatesToNode(data []byte) {
|
||||
break
|
||||
}
|
||||
|
||||
if rand_nonce = edit_blob(data); rand_nonce != nil {
|
||||
data = rand_nonce
|
||||
}
|
||||
|
||||
go func(k *websocket.Conn, v *user_session) {
|
||||
defer globals.Recover(2)
|
||||
fmt.Printf("%4d miners connected\r", CountMiners())
|
||||
|
Loading…
x
Reference in New Issue
Block a user