Browse Source

Remember best share per pool and return in API pools

nfactor-troky
Kano 12 years ago
parent
commit
03f626e68d
  1. 9
      API-README
  2. 1
      api.c
  3. 2
      cgminer.c
  4. 1
      miner.h

9
API-README

@ -400,7 +400,14 @@ miner.php - an example web page to access the API
Feature Changelog for external applications using the API: Feature Changelog for external applications using the API:
API V1.23 API V1.24
Modified API commands:
'pools' - add 'Best Share'
----------
API V1.23 (cgminer v2.10.2)
Added API commands: Added API commands:
'pgaset' - with: MMQ opt=clock val=160 to 230 (and a multiple of 2) 'pgaset' - with: MMQ opt=clock val=160 to 230 (and a multiple of 2)

1
api.c

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

2
cgminer.c

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

1
miner.h

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

Loading…
Cancel
Save