Browse Source

Revert "Check we don't exhaust the entire unsigned 32 bit ntime range when rolling time to cope with extremely high hashrates."

This reverts commit 522f620c89.

Unrealistic. Limits are bitcoind related to 2 hours in the future.
nfactor-troky
Con Kolivas 13 years ago
parent
commit
bcec5f5102
  1. 9
      cgminer.c

9
cgminer.c

@ -3649,17 +3649,13 @@ static inline bool can_roll(struct work *work)
return (work->pool && !stale_work(work, false) && work->rolltime && !work->clone); return (work->pool && !stale_work(work, false) && work->rolltime && !work->clone);
} }
static bool roll_work(struct work *work) static void roll_work(struct work *work)
{ {
uint32_t *work_ntime; uint32_t *work_ntime;
uint32_t ntime; uint32_t ntime;
work_ntime = (uint32_t *)(work->data + 68); work_ntime = (uint32_t *)(work->data + 68);
ntime = be32toh(*work_ntime); ntime = be32toh(*work_ntime);
if (unlikely(ntime == 0xFFFFFFFF)) {
applog(LOG_DEBUG, "Exhausted ntime space, cannot roll work");
return false;
}
ntime++; ntime++;
*work_ntime = htobe32(ntime); *work_ntime = htobe32(ntime);
local_work++; local_work++;
@ -3670,13 +3666,12 @@ static bool roll_work(struct work *work)
/* This is now a different work item so it needs a different ID for the /* This is now a different work item so it needs a different ID for the
* hashtable */ * hashtable */
work->id = total_work++; work->id = total_work++;
return true;
} }
static bool reuse_work(struct work *work) static bool reuse_work(struct work *work)
{ {
if (can_roll(work) && should_roll(work)) { if (can_roll(work) && should_roll(work)) {
if (likely(roll_work(work))) roll_work(work);
return true; return true;
} }
return false; return false;

Loading…
Cancel
Save