|
|
@ -3350,6 +3350,17 @@ static void _copy_work(struct work *work, const struct work *base_work, int noff |
|
|
|
work->coinbase = strdup(base_work->coinbase); |
|
|
|
work->coinbase = strdup(base_work->coinbase); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void set_work_ntime(struct work *work, int ntime) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
uint32_t *work_ntime = (uint32_t *)(work->data + 68); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*work_ntime = htobe32(ntime); |
|
|
|
|
|
|
|
if (work->ntime) { |
|
|
|
|
|
|
|
free(work->ntime); |
|
|
|
|
|
|
|
work->ntime = bin2hex((unsigned char *)work_ntime, 4); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* Generates a copy of an existing work struct, creating fresh heap allocations
|
|
|
|
/* Generates a copy of an existing work struct, creating fresh heap allocations
|
|
|
|
* for all dynamically allocated arrays within the struct. noffset is used for |
|
|
|
* for all dynamically allocated arrays within the struct. noffset is used for |
|
|
|
* when a driver has internally rolled the ntime, noffset is a relative value. |
|
|
|
* when a driver has internally rolled the ntime, noffset is a relative value. |
|
|
|