zone117x / node-stratum-pool

High performance Stratum poolserver in Node.js
GNU General Public License v2.0
419 stars 854 forks source link

Block Difficulty Change In CURRENT block #170

Closed ghost closed 4 years ago

ghost commented 5 years ago

Some coins changes difficulty over time in CURRENT block, and this makes block polling just after a jobrebroadcasttimeout in node-stratum-pool effectively detecting current block difficulty change and send a work restart request to miners.

https://github.com/Lightningcash-dev/node-stratum-pool

Changes in pool.js to force the new difficulty in current block detection :

https://github.com/Lightningcash-dev/node-stratum-pool/commit/e0fc581a1e364fb62023831fd927182a95e9b1b6

And changes in jobManager.js to send the new work information to miners :

https://github.com/Lightningcash-dev/node-stratum-pool/commit/6db683fc30dc6f28737e2646cb2561367ef3d5cd

HashUnlimited commented 4 years ago

First of all, changing diff "on-the-fly" is the perfect recipe for a hard fork. Second, we're not going to bash the daemon RPC on every program cycle, you are free to set the time for block template requests as you wish.