mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-22 20:44:19 +00:00
API V1.25 - add 'Last Valid Work' time for each device
This commit is contained in:
parent
cc3869e5ce
commit
c14f2ec642
12
API-README
12
API-README
@ -140,6 +140,8 @@ The list of requests - a (*) means it requires privileged access - and replies a
|
||||
Last Share Time=NNN, <- standand long time in seconds
|
||||
(or 0 if none) of last accepted share
|
||||
Last Share Pool=N, <- pool number (or -1 if none)
|
||||
Last Valid Work=NNN, <- standand long time in seconds
|
||||
of last work returned that wasn't an HW:
|
||||
Will not report PGAs if PGA mining is disabled
|
||||
Will not report CPUs if CPU mining is disabled
|
||||
|
||||
@ -412,7 +414,14 @@ miner.php - an example web page to access the API
|
||||
Feature Changelog for external applications using the API:
|
||||
|
||||
|
||||
API V1.24
|
||||
API V1.25
|
||||
|
||||
Modified API commands:
|
||||
'devs' 'gpu' and 'pga' - add 'Last Valid Work'
|
||||
|
||||
----------
|
||||
|
||||
API V1.24 (cgminer v2.11.0)
|
||||
|
||||
Added API commands:
|
||||
'zero'
|
||||
@ -420,6 +429,7 @@ Added API commands:
|
||||
Modified API commands:
|
||||
'pools' - add 'Best Share'
|
||||
'devs' and 'pga' - add 'No Device' for PGAs if MMQ or BFL compiled
|
||||
'stats' - add pool: 'Net Bytes Sent', 'Net Bytes Recv'
|
||||
|
||||
----------
|
||||
|
||||
|
3
api.c
3
api.c
@ -133,7 +133,7 @@ static const char SEPARATOR = '|';
|
||||
#define SEPSTR "|"
|
||||
static const char GPUSEP = ',';
|
||||
|
||||
static const char *APIVERSION = "1.24";
|
||||
static const char *APIVERSION = "1.25";
|
||||
static const char *DEAD = "Dead";
|
||||
#if defined(HAVE_OPENCL) || defined(HAVE_AN_FPGA)
|
||||
static const char *SICK = "Sick";
|
||||
@ -1623,6 +1623,7 @@ static void cpustatus(struct io_data *io_data, int cpu, bool isjson, bool precom
|
||||
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);
|
||||
root = api_add_time(root, "Last Valid Work", &(cgpu->last_device_valid_work), false);
|
||||
|
||||
root = print_data(root, buf, isjson, precom);
|
||||
io_add(io_data, buf);
|
||||
|
@ -5406,6 +5406,10 @@ static bool hashtest(struct thr_info *thr, struct work *work)
|
||||
goto out;
|
||||
}
|
||||
|
||||
mutex_lock(&stats_lock);
|
||||
thr->cgpu->last_device_valid_work = time(NULL);
|
||||
mutex_unlock(&stats_lock);
|
||||
|
||||
ret = fulltest(hash2, work->target);
|
||||
if (!ret) {
|
||||
applog(LOG_INFO, "Share below target");
|
||||
|
Loading…
x
Reference in New Issue
Block a user