Browse Source

Adjust the binary ntime data in submit_noffset_nonce even when there is no hex ntime string for eg. gbt.

Con Kolivas 12 years ago
parent
commit
3ffc3f1d78
1 changed files with 6 additions and 0 deletions
  1. 6 0
      cgminer.c

+ 6 - 0
cgminer.c

@@ -3583,6 +3583,12 @@ static void _copy_work(struct work *work, const struct work *base_work, int noff
 			work->ntime = offset_ntime(base_work->ntime, noffset);
 			work->ntime = offset_ntime(base_work->ntime, noffset);
 		} else
 		} else
 			work->ntime = strdup(base_work->ntime);
 			work->ntime = strdup(base_work->ntime);
+	} else if (noffset) {
+		uint32_t *work_ntime = (uint32_t *)(work->data + 68);
+		uint32_t ntime = be32toh(*work_ntime);
+
+		ntime += noffset;
+		*work_ntime = htobe32(ntime);
 	}
 	}
 	if (base_work->coinbase)
 	if (base_work->coinbase)
 		work->coinbase = strdup(base_work->coinbase);
 		work->coinbase = strdup(base_work->coinbase);