Skip to content

Commit

Permalink
Updated comment
Browse files Browse the repository at this point in the history
  • Loading branch information
thehenrytsai committed Jan 11, 2024
1 parent 54c128b commit b6dfc11
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/registration/proof-of-work-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,11 @@ export class ProofOfWorkManager {
= (this.currentMaximumHashValueAsBigInt * BigInt(scaleFactor)) /
(BigInt(Math.floor(currentSolveRateInFractionOfDesiredSolveRate * this.difficultyIncreaseMultiplier * scaleFactor)));

// This should also be relative to how often the difficulty is reevaluated if the reevaluation frequency is adjustable.
const hashValueDecreaseAmountPriorToEvaluationFrequencyAdjustment
= (this.currentMaximumHashValueAsBigInt - newMaximumHashValueAsBigIntPriorToMultiplierAdjustment) *
(BigInt(Math.floor(this.difficultyIncreaseMultiplier * scaleFactor)) / BigInt(scaleFactor));

= (this.currentMaximumHashValueAsBigInt - newMaximumHashValueAsBigIntPriorToMultiplierAdjustment) *
(BigInt(Math.floor(this.difficultyIncreaseMultiplier * scaleFactor)) / BigInt(scaleFactor));

// Adjustment based on the reevaluation frequency to provide more-or-less consistent behavior regardless of the reevaluation frequency.
const hashValueDecreaseAmount = hashValueDecreaseAmountPriorToEvaluationFrequencyAdjustment / BigInt(difficultyEvaluationsPerMinute);

this.currentMaximumHashValueAsBigInt -= hashValueDecreaseAmount;
Expand Down

0 comments on commit b6dfc11

Please sign in to comment.