diff --git a/proxy/client.go b/proxy/client.go index d40fc9b..b402dee 100644 --- a/proxy/client.go +++ b/proxy/client.go @@ -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) + } } } diff --git a/proxy/server.go b/proxy/server.go index dd7a10e..e385682 100644 --- a/proxy/server.go +++ b/proxy/server.go @@ -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())