Browse Source

Merge commit '03f626e' into cg_merges_20130120a

Conflicts:
	API-README
	api.c
Luke Dashjr 13 years ago
parent
commit
1997bfccaa
4 changed files with 11 additions and 0 deletions
  1. 7 0
      API-README
  2. 1 0
      api.c
  3. 2 0
      miner.c
  4. 1 0
      miner.h

+ 7 - 0
API-README

@@ -398,6 +398,13 @@ miner.php - an example web page to access the API
 Feature Changelog for external applications using the API:
 
 
+API V1.24
+
+Modified API commands:
+ 'pools' - add 'Best Share'
+
+----------
+
 API V1.23 (BFGMiner v2.10.1)
 
 Added API commands:

+ 1 - 0
api.c

@@ -1902,6 +1902,7 @@ static void poolstatus(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __m
 			root = api_add_escape(root, "Stratum URL", pool->stratum_url, false);
 		else
 			root = api_add_const(root, "Stratum URL", BLANK, false);
+		root = api_add_uint64(root, "Best Share", &(pool->best_diff), true);
 
 		root = print_data(root, buf, isjson, isjson && (i > 0));
 		io_add(io_data, buf);

+ 2 - 0
miner.c

@@ -2566,6 +2566,8 @@ static uint64_t share_diff(const struct work *work)
 		best_diff = ret;
 		suffix_string(best_diff, best_share, 0);
 	}
+	if (ret > work->pool->best_diff)
+		work->pool->best_diff = ret;
 	mutex_unlock(&control_lock);
 	return ret;
 }

+ 1 - 0
miner.h

@@ -969,6 +969,7 @@ struct pool {
 
 	time_t last_share_time;
 	double last_share_diff;
+	uint64_t best_diff;
 
 	struct cgminer_stats cgminer_stats;
 	struct cgminer_pool_stats cgminer_pool_stats;