Skip to content

Commit

Permalink
Fix inaccurate uptime calculation due to remainder
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-CZ committed Dec 13, 2024
1 parent e86e5db commit b2c4669
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions contracts/sfc/SFC.sol
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,7 @@ contract SFC is OwnableUpgradeable, UUPSUpgradeable, Version {

if (cur.averageUptime > Decimal.unit()) {
cur.averageUptime = uint64(Decimal.unit());
cur.remainder = 0; // reset the remainder when capping the averageUptime
}
if (prev.epochs < c.averageUptimeEpochWindow()) {
cur.epochs = prev.epochs + 1;
Expand Down

0 comments on commit b2c4669

Please sign in to comment.