Had issues with hashrate calculation causing divide by zero exceptions, and restarting the client connection. Tried to use nanoseconds to capture elapsed time, but still some hash calculations were very fast, resulting in the same exception.
Changed to logic to just send invalid data back, when the elapsed time is zero. While this results in a rejected response, it keeps the client connection active.
--
Obviously that, while trying to determine a good miner response message was for this scenario, I changed the hashrate calculation to report THs/s , and got a warning in my account :-) Hope this doesn't get me banned!
Had issues with hashrate calculation causing divide by zero exceptions, and restarting the client connection. Tried to use nanoseconds to capture elapsed time, but still some hash calculations were very fast, resulting in the same exception.
Changed to logic to just send invalid data back, when the elapsed time is zero. While this results in a rejected response, it keeps the client connection active.
-- Obviously that, while trying to determine a good miner response message was for this scenario, I changed the hashrate calculation to report THs/s , and got a warning in my account :-) Hope this doesn't get me banned!