Skip to content

Negative Shares/Diff percentage?!? #59

Open

Description

@roshljo

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?

Activity

  1. leisegang commented on Jan 31, 2018

    @leisegang

    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

  2. leisegang commented on Jan 31, 2018

    @leisegang

    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>'; }

  3. roshljo commented on Jan 31, 2018

    @roshljo
    Author

    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.

  4. leisegang commented on Feb 1, 2018

    @leisegang

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

  5. roshljo commented on Feb 27, 2018

    @roshljo
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions