Commit fc4279136e76d258a4ba886d5d5719c6f87e0b0b

Con Kolivas 2011-09-14T21:48:53

Use the longpoll provided work to test_work_current since we know it's almost certainly from a new block even though we may check it later again.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/main.c b/main.c
index 0f6cfd7..fdb4e3d 100644
--- a/main.c
+++ b/main.c
@@ -4346,6 +4346,10 @@ static void convert_to_work(json_t *val, bool rolltime)
 	}
 	work->pool = current_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
+	 * rather than waiting for it to hit the stage thread */
+	test_work_current(work);
 
 	if (opt_debug)
 		applog(LOG_DEBUG, "Pushing converted work to stage thread");