Crypto-Expert / stratum-mining

AIO Stratum mining server for various coins
Other
365 stars 348 forks source link

USE_COINDAEMON_DIFF uses incorrect difficulty #351

Closed llamasoft closed 9 years ago

llamasoft commented 10 years ago

The USE_COINDAEMON_DIFF setting fails to convert the "network difficulty" into "share difficulty". It should take into consideration the algorithm's diff1 value.

For example, if a network using the scrypt algorithm has a difficulty of 1.00, then the corresponding share difficulty that solves the block is 65536. (i.e. network_diff = share_diff / 65536)
However, basic_share_limiter.py uses the coin daemon's difficulty as-is without adjustment. That means if the network difficulty is 1.00, then diff_max becomes 1, which is very wrong.

I would submit a pull request for this but I'm uncertain how to programmatically convert network difficulty to share difficulty. I suspect it will involve the diff1 values from the template_registry class, but I'm unsure on how to integrate the values as hex.

ahmedbodi commented 9 years ago

Fixed here here: https://github.com/Multicoin-co/stratum-mining/pull/2 now you can specify your own diff1 and algo (i think)