Browse Source

Clear work stratum strings before setting them and add them to debug output.

Con Kolivas 13 years ago
parent
commit
f0901e0a26
1 changed files with 5 additions and 0 deletions
  1. 5 0
      cgminer.c

+ 5 - 0
cgminer.c

@@ -4525,6 +4525,10 @@ static void gen_stratum_work(struct pool *pool, struct work *work)
 	int len, cb1_len, n1_len, cb2_len, i;
 	uint32_t *data32, *swap32;
 
+	memset(work->job_id, 0, 64);
+	memset(work->nonce2, 0, 64);
+	memset(work->ntime, 0, 16);
+
 	mutex_lock(&pool->pool_lock);
 
 	/* Generate coinbase */
@@ -4583,6 +4587,7 @@ static void gen_stratum_work(struct pool *pool, struct work *work)
 
 	applog(LOG_DEBUG, "Generated stratum merkle %s", merkle_hash);
 	applog(LOG_DEBUG, "Generated stratum header %s", header);
+	applog(LOG_DEBUG, "Work job_id %s nonce2 %s ntime %s", work->job_id, work->nonce2, work->ntime);
 
 	free(merkle_hash);