Skip to content

Commit

Permalink
updated initialization check
Browse files Browse the repository at this point in the history
  • Loading branch information
soloseng committed Sep 24, 2024
1 parent 2379af0 commit 9ac350a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/protocol/contracts-0.8/common/EpochManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ contract EpochManager is
bool processed;
uint256 epochRewards;
}

bool public isSystemInitialized;
// the length of an epoch in seconds
uint256 public epochDuration;

Expand Down Expand Up @@ -143,6 +143,7 @@ contract EpochManager is
"First epoch block must be less or equal than current block"
);
require(firstElected.length > 0, "First elected validators must be greater than 0");
isSystemInitialized = true;
firstKnownEpoch = firstEpochNumber;
currentEpochNumber = firstEpochNumber;

Expand Down Expand Up @@ -376,7 +377,7 @@ contract EpochManager is
}

function systemAlreadyInitialized() public view returns (bool) {
return initialized && elected.length > 0;
return initialized && isSystemInitialized;
}

/**
Expand Down

0 comments on commit 9ac350a

Please sign in to comment.