mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-29 16:04:33 +00:00
API add 'Network Difficulty' to 'coin'
This commit is contained in:
parent
540f3e89bc
commit
0eafc8b9fe
@ -306,7 +306,8 @@ The list of requests - a (*) means it requires privileged access - and replies a
|
||||
Hash Method=sha256/scrypt,
|
||||
Current Block Time=N.N, <- 0 means none
|
||||
Current Block Hash=XXXX..., <- blank if none
|
||||
LP=true/false| <- LP is in use on at least 1 pool
|
||||
LP=true/false, <- LP is in use on at least 1 pool
|
||||
Network Difficulty=NN.NN|
|
||||
|
||||
debug|setting (*)
|
||||
DEBUG Debug settings
|
||||
@ -430,6 +431,7 @@ Added API commands:
|
||||
Modified API commands:
|
||||
'devs' 'gpu' and 'pga' - add 'Last Valid Work'
|
||||
'config' - add 'Hotplug'
|
||||
'coin' - add 'Network Difficulty'
|
||||
|
||||
----------
|
||||
|
||||
|
1
api.c
1
api.c
@ -3210,6 +3210,7 @@ static void minecoin(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __may
|
||||
mutex_unlock(&ch_lock);
|
||||
|
||||
root = api_add_bool(root, "LP", &have_longpoll, false);
|
||||
root = api_add_diff(root, "Network Difficulty", ¤t_diff, true);
|
||||
|
||||
root = print_data(root, buf, isjson, false);
|
||||
io_add(io_data, buf);
|
||||
|
@ -232,6 +232,7 @@ static char datestamp[40];
|
||||
static char blocktime[32];
|
||||
struct timeval block_timeval;
|
||||
static char best_share[8] = "0";
|
||||
double current_diff;
|
||||
static char block_diff[8];
|
||||
uint64_t best_diff = 0;
|
||||
|
||||
@ -3607,6 +3608,7 @@ static void set_blockdiff(const struct work *work)
|
||||
|
||||
diff64 = diffone / d64;
|
||||
suffix_string(diff64, block_diff, 0);
|
||||
current_diff = (double)diffone / (double)d64;
|
||||
}
|
||||
|
||||
static bool test_work_current(struct work *work)
|
||||
|
Loading…
x
Reference in New Issue
Block a user