Commit 1321cb0e0d4f2ba2262e7b11a96d9defc62ca7b5

Con Kolivas 2012-11-05T17:57:33

Generate a gbt work item from longpoll when required to set new block and message appropriately.

diff --git a/cgminer.c b/cgminer.c
index 504ed24..ab5657e 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -5598,15 +5598,18 @@ static void convert_to_work(json_t *val, int rolltime, struct pool *pool, struct
 	}
 	work->pool = pool;
 	work->rolltime = rolltime;
-	work->longpoll = true;
 	memcpy(&(work->tv_getwork), tv_lp, sizeof(struct timeval));
 	memcpy(&(work->tv_getwork_reply), tv_lp_reply, sizeof(struct timeval));
-	work->getwork_mode = GETWORK_MODE_LP;
 	calc_diff(work, 0);
 
 	if (pool->enabled == POOL_REJECTING)
 		work->mandatory = true;
 
+	if (pool->has_gbt)
+		gen_gbt_work(pool, work);
+	work->longpoll = true;
+	work->getwork_mode = GETWORK_MODE_LP;
+
 	/* We'll be checking this work item twice, but we already know it's
 	 * from a new block so explicitly force the new block detection now
 	 * rather than waiting for it to hit the stage thread. This also