From ac0d303075e22f9d3d829ef01d7b6e7a97179fa3 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 29 Sep 2011 09:46:32 +1000 Subject: [PATCH] Don't make donation work interfere with block change detection allowing donation to work regardless of the block chain we're mining on. --- main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.c b/main.c index 031b87ca..21c515ec 100644 --- a/main.c +++ b/main.c @@ -2502,6 +2502,10 @@ static bool stale_work(struct work *work) if ((now.tv_sec - work->tv_staged.tv_sec) >= opt_scantime) return true; + /* Don't compare donor work in case it's on a different chain */ + if (donor(work->pool)) + return ret; + hexstr = bin2hex(work->data, 18); if (unlikely(!hexstr)) { applog(LOG_ERR, "submit_work_thread OOM"); @@ -2766,6 +2770,11 @@ static void test_work_current(struct work *work, bool longpoll) struct block *s; char *hexstr; + /* Allow donation to not set current work, so it will work even if + * mining on a different chain */ + if (donor(work->pool)) + return; + hexstr = bin2hex(work->data, 18); if (unlikely(!hexstr)) { applog(LOG_ERR, "stage_thread OOM");