Browse Source

Bugfix: Stratum: Dereference pool swork coinbase buffer inside data lock

Luke Dashjr 12 years ago
parent
commit
77726096cf
1 changed files with 1 additions and 2 deletions
  1. 1 2
      miner.c

+ 1 - 2
miner.c

@@ -7153,8 +7153,6 @@ static void gen_stratum_work(struct pool *pool, struct work *work)
 	uint8_t *merkle_bin;
 	uint32_t *data32, *swap32;
 	int i;
-	
-	coinbase = bytes_buf(&pool->swork.coinbase);
 
 	clean_work(work);
 
@@ -7162,6 +7160,7 @@ static void gen_stratum_work(struct pool *pool, struct work *work)
 	cg_ilock(&pool->data_lock);
 
 	/* Generate coinbase */
+	coinbase = bytes_buf(&pool->swork.coinbase);
 	// FIXME: This only works if (n2size == 4) || (n2size < 4 && littleendian)
 	bytes_resize(&work->nonce2, pool->n2size);
 	memcpy(bytes_buf(&work->nonce2), &pool->nonce2, pool->n2size);