Commit e55fe73f9a62985066b4d240167871c154038dbe

Kano 2012-12-03T23:08:11

API add Best Share to summary

diff --git a/API-README b/API-README
index 54d601e..407321f 100644
--- a/API-README
+++ b/API-README
@@ -392,7 +392,10 @@ Added API commands:
  'usbstats'
 
 Modified API commands:
- each MMQ shows up as 4 devices each with it's own stats
+ 'summary' - add 'Best Share'
+
+Modifed output:
+ each MMQ shows up as 4 devices, each with it's own stats
 
 ----------
 
diff --git a/api.c b/api.c
index d4832fc..5a4d718 100644
--- a/api.c
+++ b/api.c
@@ -1913,6 +1913,7 @@ static void summary(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, boo
 	root = api_add_diff(root, "Difficulty Accepted", &(total_diff_accepted), true);
 	root = api_add_diff(root, "Difficulty Rejected", &(total_diff_rejected), true);
 	root = api_add_diff(root, "Difficulty Stale", &(total_diff_stale), true);
+	root = api_add_uint64(root, "Best Share", &(best_diff), true);
 
 	mutex_unlock(&hash_lock);
 
diff --git a/cgminer.c b/cgminer.c
index 721dadd..bbc0ef2 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -228,7 +228,7 @@ static char datestamp[40];
 static char blocktime[32];
 struct timeval block_timeval;
 static char best_share[8] = "0";
-static uint64_t best_diff = 0;
+uint64_t best_diff = 0;
 
 struct block {
 	char hash[40];
diff --git a/miner.h b/miner.h
index 2e34236..c6548b3 100644
--- a/miner.h
+++ b/miner.h
@@ -786,6 +786,7 @@ extern const int opt_cutofftemp;
 extern int opt_log_interval;
 extern unsigned long long global_hashrate;
 extern char *current_fullhash;
+extern uint64_t best_diff;
 extern struct timeval block_timeval;
 
 #ifdef HAVE_OPENCL