Commit 291f1749d0b77a12792ee3797157f7e89a27ffa7

Con Kolivas 2011-12-27T09:38:57

Ensure the correct pool information goes with the longpoll work item.

diff --git a/main.c b/main.c
index 65dbed5..da3145a 100644
--- a/main.c
+++ b/main.c
@@ -4846,7 +4846,7 @@ out:
 #endif /* HAVE_OPENCL */
 
 /* Stage another work item from the work returned in a longpoll */
-static void convert_to_work(json_t *val, bool rolltime)
+static void convert_to_work(json_t *val, bool rolltime, struct pool *pool)
 {
 	struct work *work;
 	bool rc;
@@ -4858,7 +4858,7 @@ static void convert_to_work(json_t *val, bool rolltime)
 		applog(LOG_ERR, "Could not convert longpoll data to work");
 		return;
 	}
-	work->pool = current_pool();
+	work->pool = pool;
 	work->rolltime = rolltime;
 	/* 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
@@ -4951,7 +4951,7 @@ static void *longpoll_thread(void *userdata)
 		val = json_rpc_call(curl, lp_url, pool->rpc_userpass, rpc_req,
 				    false, true, &rolltime, pool);
 		if (likely(val)) {
-			convert_to_work(val, rolltime);
+			convert_to_work(val, rolltime, pool);
 			failures = 0;
 			json_decref(val);
 		} else {