Browse Source

Add notice for when network diff is changed.

Con Kolivas 13 years ago
parent
commit
1a7fc4e9cc
1 changed files with 4 additions and 0 deletions
  1. 4 0
      cgminer.c

+ 4 - 0
cgminer.c

@@ -3648,6 +3648,7 @@ static int block_sort(struct block *blocka, struct block *blockb)
 static void set_blockdiff(const struct work *work)
 static void set_blockdiff(const struct work *work)
 {
 {
 	uint64_t *data64, d64, diff64;
 	uint64_t *data64, d64, diff64;
+	double previous_diff;
 	uint32_t diffhash[8];
 	uint32_t diffhash[8];
 	uint32_t difficulty;
 	uint32_t difficulty;
 	uint32_t diffbytes;
 	uint32_t diffbytes;
@@ -3683,9 +3684,12 @@ static void set_blockdiff(const struct work *work)
 	if (unlikely(!d64))
 	if (unlikely(!d64))
 		d64 = 1;
 		d64 = 1;
 
 
+	previous_diff = current_diff;
 	diff64 = diffone / d64;
 	diff64 = diffone / d64;
 	suffix_string(diff64, block_diff, 0);
 	suffix_string(diff64, block_diff, 0);
 	current_diff = (double)diffone / (double)d64;
 	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)
 static bool test_work_current(struct work *work)