API add Best Share to summary
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
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