nearestPowerOfTwo

This commit is contained in:
Ben Wilson 2023-08-06 23:05:14 -04:00
parent 72d2f63315
commit b0d7f37533

View File

@ -51,7 +51,8 @@ export class StratumV1ClientStatistics {
// miner hasn't submitted shares in one minute
if (this.submissionCache.length == 0) {
if ((new Date().getTime() - this.submissionCacheStart.getTime()) / 1000 > 60) {
return this.nearestPowerOfTwo(clientDifficulty / 6);
//return this.nearestPowerOfTwo(clientDifficulty / 6);
return clientDifficulty / 6;
} else {
return null;
}
@ -68,7 +69,8 @@ export class StratumV1ClientStatistics {
const targetDifficulty = difficultyPerSecond * TARGET_SUBMISSION_PER_SECOND;
if ((clientDifficulty * 2) < targetDifficulty || (clientDifficulty / 2) > targetDifficulty) {
return this.nearestPowerOfTwo(targetDifficulty)
// return this.nearestPowerOfTwo(targetDifficulty)
return targetDifficulty;
}
return null;