Skip to content

Fix divide by zero on hashrate calculation (sends nonce with zero hashrate) - #1767

Merged
revoxhere merged 1 commit into
duino-coin:masterfrom
GerardoNevarez:fix_fasthash_divide_by_zero
Mar 25, 2024
Merged

Fix divide by zero on hashrate calculation (sends nonce with zero hashrate)#1767
revoxhere merged 1 commit into
duino-coin:masterfrom
GerardoNevarez:fix_fasthash_divide_by_zero

Conversation

@GerardoNevarez

Copy link
Copy Markdown
Contributor

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!

@revoxhere
revoxhere merged commit e3bc567 into duino-coin:master Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants