From e532ac354a70743f2f4aa526d4d2c4c63a5d9f42 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 18 Jul 2011 11:37:33 +1000 Subject: [PATCH] Only clear the longpoll block data if we successfully received a longpoll, and do it before converting the longpoll data to work to avoid the staging thread believing it got the new work before the longpoll. --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 08dc54af..c2c471aa 100644 --- a/main.c +++ b/main.c @@ -1891,6 +1891,7 @@ static void *longpoll_thread(void *userdata) val = json_rpc_call(curl, lp_url, rpc_userpass, rpc_req, false, true); if (likely(val)) { + memcpy(longpoll_block, current_block, 36); convert_to_work(val); failures = 0; json_decref(val); @@ -1922,7 +1923,6 @@ static void *longpoll_thread(void *userdata) goto out; } } - memcpy(longpoll_block, current_block, 36); } out: