@@ -70,7 +70,7 @@ void submit_new_block(mining_worker_t *worker)
7070
7171 ssize_t buf_size = write_new_block (worker, write_buffer);
7272 uv_buf_t buf = uv_buf_init ((char *)write_buffer, buf_size);
73- print_hex_with_info (" new solution" , (uint8_t *) hasher_hash (worker, true ), 32 , height, from_group, to_group);
73+ print_hex_with_info (" new solution" , (uint8_t *) hasher_hash (worker, true ), 32 , height, from_group, to_group, worker-> id );
7474
7575 uv_write_t *write_req = (uv_write_t *)malloc (sizeof (uv_write_t ));
7676 uint32_t buf_count = 1 ;
@@ -128,14 +128,16 @@ void after_mine(uv_work_t *req, int status)
128128void worker_stream_callback (cudaStream_t stream, cudaError_t status, void *data)
129129{
130130 mining_worker_t *worker = (mining_worker_t *)data;
131+ mining_template_t *template_ptr = load_worker__template (worker);
132+ job_t *job = template_ptr->job ;
131133 if (hasher_found_good_hash (worker, true ))
132134 {
133135 store_worker_found_good_hash (worker, true );
134136 submit_new_block (worker);
137+ } else {
138+ // LOG("Not found good hash: %d -> %d, height: %d, worker: %d\n", job->from_group, job->to_group, job->height, worker->id);
135139 }
136140
137- mining_template_t *template_ptr = load_worker__template (worker);
138- job_t *job = template_ptr->job ;
139141 uint32_t chain_index = job->from_group * group_nums + job->to_group ;
140142 mining_counts[chain_index].fetch_sub (mining_steps);
141143 mining_counts[chain_index].fetch_add (hasher_hash_count (worker, true ));
@@ -249,6 +251,8 @@ void try_to_reconnect(uv_timer_t *timer){
249251 uv_timer_stop (timer);
250252}
251253
254+ int job_counts = 0 ;
255+
252256void on_read (uv_stream_t *server, ssize_t nread, const uv_buf_t *buf)
253257{
254258 if (nread < 0 )
@@ -263,12 +267,15 @@ void on_read(uv_stream_t *server, ssize_t nread, const uv_buf_t *buf)
263267 return ;
264268 }
265269
270+ LOG (" =========== job conts %d\n " , job_counts);
271+
266272 server_message_t *message = decode_buf (buf, nread);
267273 if (message)
268274 {
269275 switch (message->kind )
270276 {
271277 case JOBS:
278+ job_counts += 1 ;
272279 for (int i = 0 ; i < message->jobs ->len ; i++)
273280 {
274281 update_templates (message->jobs ->jobs [i]);
0 commit comments