mirror of
https://github.com/GOSTSec/gostoclminer
synced 2025-01-14 16:58:03 +00:00
submit_nonce()
This commit is contained in:
parent
53da7abb6c
commit
98dbb8ea72
14
miner.c
14
miner.c
@ -247,6 +247,14 @@ static bool getwork(struct work_t *work) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void submit_nonce(struct work_t *work, uint32_t nonce) {
|
||||||
|
work->data[64+12+0] = (nonce>>0) & 0xff;
|
||||||
|
work->data[64+12+1] = (nonce>>8) & 0xff;
|
||||||
|
work->data[64+12+2] = (nonce>>16) & 0xff;
|
||||||
|
work->data[64+12+3] = (nonce>>24) & 0xff;
|
||||||
|
submit_work(work);
|
||||||
|
}
|
||||||
|
|
||||||
static void *miner_thread(void *thr_id_int)
|
static void *miner_thread(void *thr_id_int)
|
||||||
{
|
{
|
||||||
int thr_id = (unsigned long) thr_id_int;
|
int thr_id = (unsigned long) thr_id_int;
|
||||||
@ -371,11 +379,7 @@ static void *miner_thread(void *thr_id_int)
|
|||||||
if(rc && bestG <= *target) {
|
if(rc && bestG <= *target) {
|
||||||
printf("Found solution for %08x: %08x %u\n", *target, bestG, nonce);
|
printf("Found solution for %08x: %08x %u\n", *target, bestG, nonce);
|
||||||
|
|
||||||
work[res_frame].data[64+12+0] = (nonce>>0) & 0xff;
|
submit_nonce(&work[res_frame], nonce);
|
||||||
work[res_frame].data[64+12+1] = (nonce>>8) & 0xff;
|
|
||||||
work[res_frame].data[64+12+2] = (nonce>>16) & 0xff;
|
|
||||||
work[res_frame].data[64+12+3] = (nonce>>24) & 0xff;
|
|
||||||
submit_work(&work[res_frame]);
|
|
||||||
|
|
||||||
block++;
|
block++;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user