From e95eaf038f94cd66941b963085a482a82eca29bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Volpe?= Date: Thu, 28 Nov 2024 14:04:27 +0100 Subject: [PATCH] Epoch can not be restarted --- .../protocol/contracts-0.8/common/EpochManager.sol | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/protocol/contracts-0.8/common/EpochManager.sol b/packages/protocol/contracts-0.8/common/EpochManager.sol index 8856fed09c..2c474ed086 100644 --- a/packages/protocol/contracts-0.8/common/EpochManager.sol +++ b/packages/protocol/contracts-0.8/common/EpochManager.sol @@ -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; @@ -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(); } /** @@ -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(); } /**