Provide a function for setting the work ntime.
diff --git a/cgminer.c b/cgminer.c
index eba7854..e1e4f87 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -3529,6 +3529,17 @@ static void _copy_work(struct work *work, const struct work *base_work, int noff
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
* 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.
diff --git a/miner.h b/miner.h
index ef05dad..613659c 100644
--- a/miner.h
+++ b/miner.h
@@ -1475,6 +1475,7 @@ extern void adl(void);
extern void app_restart(void);
extern void clean_work(struct work *work);
extern void free_work(struct work *work);
+extern void set_work_ntime(struct work *work, int ntime);
extern struct work *copy_work_noffset(struct work *base_work, int noffset);
#define copy_work(work_in) copy_work_noffset(work_in, 0)
extern struct thr_info *get_thread(int thr_id);