Browse Source

Merge commit 'a6bf276' into cgmerges

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

+ 8 - 4
API-README

@@ -389,11 +389,15 @@ Added API commands:
  'pgaidentify|N' (only works for BFL Singles so far)
 
 Modified API commands:
- 'devs' - add 'Difficulty Accepted', 'Difficulty Rejected' to all devices
- 'gpu|N' - add 'Difficulty Accepted', 'Difficulty Rejected'
- 'pga|N' - add 'Difficulty Accepted', 'Difficulty Rejected'
+ 'devs' - add 'Difficulty Accepted', 'Difficulty Rejected',
+              'Last Share Difficulty' to all devices
+ 'gpu|N' - add 'Difficulty Accepted', 'Difficulty Rejected',
+              'Last Share Difficulty'
+ 'pga|N' - add 'Difficulty Accepted', 'Difficulty Rejected',
+              'Last Share Difficulty'
  'notify' - add '*Dev Throttle' (for BFL Singles)
- 'pools' - add 'Difficulty Accepted', 'Difficulty Rejected', 'Difficulty Stale'
+ 'pools' - add 'Difficulty Accepted', 'Difficulty Rejected',
+               'Difficulty Stale', 'Last Share Difficulty'
 
 ----------
 

+ 2 - 0
api.c

@@ -1427,6 +1427,7 @@ static void devstatus_an(struct cgpu_info *cgpu, bool isjson)
 	root = api_add_int(root, "Diff1 Work", &(cgpu->diff1), false);
 	root = api_add_diff(root, "Difficulty Accepted", &(cgpu->diff_accepted), false);
 	root = api_add_diff(root, "Difficulty Rejected", &(cgpu->diff_rejected), false);
+	root = api_add_diff(root, "Last Share Difficulty", &(cgpu->last_share_diff), false);
 
 	if (cgpu->api->get_api_extra_device_status)
 		root = api_add_extra(root, cgpu->api->get_api_extra_device_status(cgpu));
@@ -1809,6 +1810,7 @@ static void poolstatus(__maybe_unused SOCKETTYPE c, __maybe_unused char *param,
 		root = api_add_diff(root, "Difficulty Accepted", &(pool->diff_accepted), false);
 		root = api_add_diff(root, "Difficulty Rejected", &(pool->diff_rejected), false);
 		root = api_add_diff(root, "Difficulty Stale", &(pool->diff_stale), false);
+		root = api_add_diff(root, "Last Share Difficulty", &(pool->last_share_diff), false);
 
 		if (isjson && (i > 0))
 			strcat(io_buffer, COMMA);

+ 2 - 0
miner.c

@@ -2204,7 +2204,9 @@ static bool submit_upstream_work(const struct work *work, CURL *curl, bool resub
 		pool->seq_rejects = 0;
 		cgpu->last_share_pool = pool->pool_no;
 		cgpu->last_share_pool_time = time(NULL);
+		cgpu->last_share_diff = work->work_difficulty;
 		pool->last_share_time = cgpu->last_share_pool_time;
+		pool->last_share_diff = work->work_difficulty;
 		applog(LOG_DEBUG, "PROOF OF WORK RESULT: true (yay!!!)");
 		if (!QUIET) {
 			if (total_pools > 1)

+ 2 - 0
miner.h

@@ -447,6 +447,7 @@ struct cgpu_info {
 	double diff_rejected;
 	int last_share_pool;
 	time_t last_share_pool_time;
+	double last_share_diff;
 
 	time_t device_last_well;
 	time_t device_last_not_well;
@@ -874,6 +875,7 @@ struct pool {
 	struct list_head curlring;
 
 	time_t last_share_time;
+	double last_share_diff;
 
 	struct cgminer_stats cgminer_stats;
 	struct cgminer_pool_stats cgminer_pool_stats;