decred / gominer

Go (golang) based GPU miner for Decred.
GNU General Public License v3.0
160 stars 80 forks source link

Handle non-int pool difficulties better. #141

Closed jcvernaleo closed 7 years ago

jcvernaleo commented 7 years ago

Closes #140

jolan commented 7 years ago

I was trying to trigger this yesterday with intel graphics but it kept mining at diff 1 on yiimp.ccminer.org.

I remember seeing pools sending diffs < 1 awhile back so maybe we need something like:

if diff < 1
  diff = 1
else
  diff = math.Floor(diff)

I'm not clear on what diff 0 would actually do. Wouldn't it send basically everything? I guess it's easy enough to check.

jcvernaleo commented 7 years ago

We already don't allow diff <= 0 so yeah, I should set to 1 in the 0<d<1 case.

jcvernaleo commented 7 years ago

As for testing, I've had better luck see non-int diffs at dcr.maxminers.net

jcvernaleo commented 7 years ago

FYI I've been running with this pr for around 5 hours without an issue which is the longer than I've lasted without hitting the crash in #135 in a long time.