Browse Source

API add Best Share to summary

Kano 13 years ago
parent
commit
e55fe73f9a
4 changed files with 7 additions and 2 deletions
  1. 4 1
      API-README
  2. 1 0
      api.c
  3. 1 1
      cgminer.c
  4. 1 0
      miner.h

+ 4 - 1
API-README

@@ -392,7 +392,10 @@ Added API commands:
  'usbstats'
  'usbstats'
 
 
 Modified API commands:
 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
 
 
 ----------
 ----------
 
 

+ 1 - 0
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 Accepted", &(total_diff_accepted), true);
 	root = api_add_diff(root, "Difficulty Rejected", &(total_diff_rejected), 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_diff(root, "Difficulty Stale", &(total_diff_stale), true);
+	root = api_add_uint64(root, "Best Share", &(best_diff), true);
 
 
 	mutex_unlock(&hash_lock);
 	mutex_unlock(&hash_lock);
 
 

+ 1 - 1
cgminer.c

@@ -228,7 +228,7 @@ static char datestamp[40];
 static char blocktime[32];
 static char blocktime[32];
 struct timeval block_timeval;
 struct timeval block_timeval;
 static char best_share[8] = "0";
 static char best_share[8] = "0";
-static uint64_t best_diff = 0;
+uint64_t best_diff = 0;
 
 
 struct block {
 struct block {
 	char hash[40];
 	char hash[40];

+ 1 - 0
miner.h

@@ -786,6 +786,7 @@ extern const int opt_cutofftemp;
 extern int opt_log_interval;
 extern int opt_log_interval;
 extern unsigned long long global_hashrate;
 extern unsigned long long global_hashrate;
 extern char *current_fullhash;
 extern char *current_fullhash;
+extern uint64_t best_diff;
 extern struct timeval block_timeval;
 extern struct timeval block_timeval;
 
 
 #ifdef HAVE_OPENCL
 #ifdef HAVE_OPENCL