From 1a7fc4e9cc6bed9b40ac433f71e2e5b9050ae573 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 18 Apr 2013 10:47:02 +1000 Subject: [PATCH] Add notice for when network diff is changed. --- cgminer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cgminer.c b/cgminer.c index debea356..c6fef3be 100644 --- a/cgminer.c +++ b/cgminer.c @@ -3648,6 +3648,7 @@ static int block_sort(struct block *blocka, struct block *blockb) static void set_blockdiff(const struct work *work) { uint64_t *data64, d64, diff64; + double previous_diff; uint32_t diffhash[8]; uint32_t difficulty; uint32_t diffbytes; @@ -3683,9 +3684,12 @@ static void set_blockdiff(const struct work *work) if (unlikely(!d64)) d64 = 1; + previous_diff = current_diff; diff64 = diffone / d64; suffix_string(diff64, block_diff, 0); current_diff = (double)diffone / (double)d64; + if (unlikely(current_diff != previous_diff)) + applog(LOG_NOTICE, "Network diff set to %s", block_diff); } static bool test_work_current(struct work *work)