Skip to content

Commit

Permalink
Epoch can not be restarted
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvol committed Nov 28, 2024
1 parent c05e551 commit e95eaf0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/protocol/contracts-0.8/common/EpochManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ contract EpochManager is
*/
function startNextEpochProcess() external nonReentrant onlySystemAlreadyInitialized {
require(isTimeForNextEpoch(), "Epoch is not ready to start");
require(!isOnEpochProcess(), "Epoch process is already started");
require(!isEpochProcessingStarted(), "Epoch process is already started");

epochProcessing.status = EpochProcessStatus.Started;
epochs[currentEpochNumber].rewardsBlock = block.number;
Expand Down Expand Up @@ -449,7 +449,7 @@ contract EpochManager is
* @return Whether or not the blockable functions are blocked.
*/
function isBlocked() external view returns (bool) {
return isOnEpochProcess() || isIndividualProcessing();
return isEpochProcessingStarted();
}

/**
Expand Down Expand Up @@ -597,8 +597,11 @@ contract EpochManager is
}

function isIndividualProcessing() public view returns (bool) {
EpochProcessState storage _epochProcessing = epochProcessing;
return _epochProcessing.status == EpochProcessStatus.IndivudualGroupsProcessing;
return epochProcessing.status == EpochProcessStatus.IndivudualGroupsProcessing;
}

function isEpochProcessingStarted() public view returns (bool) {
return isOnEpochProcess() || isIndividualProcessing();
}

/**
Expand Down

0 comments on commit e95eaf0

Please sign in to comment.