Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative Shares/Diff percentage?!? #59

Open
roshljo opened this issue Jan 28, 2018 · 5 comments
Open

Negative Shares/Diff percentage?!? #59

roshljo opened this issue Jan 28, 2018 · 5 comments

Comments

@roshljo
Copy link

roshljo commented Jan 28, 2018

Hello, when the pool cannot find a block for some time, i.e. when the Shares/Diff percentage is obviously more than 100%, I do not get the correct value like for example 123%, but the API displays negative numbers instead! Like -93%, -37%, etc.
Any idea why, anyone?

@leisegang
Copy link

you want it to write 137% instead of -37%.

What would be more "logical" for me as well since there has been hashed 37% more than current difficulty

@leisegang
Copy link

edit the pool_blocks.html and edit it to this:

else { var accurateShares = shares; } if (difficulty > accurateShares){ var percent = 100 - Math.round(accurateShares / difficulty * 100); return '<span class="luckGood">' + percent + '%</span>'; } else{ var percent = (Math.round(accurateShares / difficulty * 100)) * 1; return '<span class="luckBad">' + percent + '%</span>'; }

@roshljo
Copy link
Author

roshljo commented Jan 31, 2018

Thank you very much, that was what I needed. I also removed the "100 - " in the case where the luck is positive, so that I now always see the shares/diff*100 as a % value there. It clearly represents the actual work done for the specific block.

@leisegang
Copy link

Please paste your updated code so other too can use it. I just did a quick and dirty update. Please share yours.

@roshljo
Copy link
Author

roshljo commented Feb 27, 2018

I use the following:
else { var accurateShares = shares; } if (difficulty > accurateShares){ var percent = Math.round(accurateShares / difficulty * 100);
return '' + percent + '%'; }
else{ var percent = (Math.round(accurateShares / difficulty * 100)) * 1; return '' + percent + '%'; }

This way the value shown is always shares/difficulty, no matter if it is 1% or 500%, only the colour changes from green to red when it is over 100%

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

No branches or pull requests

2 participants