mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-22 20:44:19 +00:00
Remember best share per pool and return in API pools
This commit is contained in:
parent
ec9b32aac0
commit
03f626e68d
@ -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
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);
|
||||||
|
@ -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
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…
x
Reference in New Issue
Block a user