Skip to content

Commit

Permalink
Fixing share diff, hopefully
Browse files Browse the repository at this point in the history
  • Loading branch information
fireduck64 committed Nov 6, 2018
1 parent 87744fe commit 9f6e916
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions miner/src/MiningPoolServiceAgent.java
Expand Up @@ -229,6 +229,7 @@ public class MinerInfo
public final GetWorkRequest req;
public final StreamObserver<WorkUnit> observer;
public int working_diff = plow.getMinDiff();
public long last_shift = 0;

public LinkedList<Long> share_times = new LinkedList<>();

Expand All @@ -253,13 +254,19 @@ public void reportShare()
{
working_diff++;
share_times.clear();
last_shift = System.currentTimeMillis();
// We don't care when the last shift was, if this gets hit, it gets hit
}
/*if (share_times.size() < MrPlow.SHARES_IN_VIEW_FOR_DOWNTARGET)
else if (share_times.size() < MrPlow.SHARES_IN_VIEW_FOR_DOWNTARGET)
{
// Intentionally not clearing the share_times here to avoid
// this being run again on the next share coming in
working_diff = Math.max(working_diff - 1, plow.getMinDiff());
}*/
if (last_shift + MrPlow.SHARE_VIEW_WINDOW < System.currentTimeMillis())
{
// Intentionally not clearing the share_times here to avoid
// this being run again on the next share coming in
working_diff = Math.max(working_diff - 1, plow.getMinDiff());
last_shift = System.currentTimeMillis();
}
}

}

Expand Down

0 comments on commit 9f6e916

Please sign in to comment.