From 9ac350a2c861543af55172f480c9ddd5d6caa250 Mon Sep 17 00:00:00 2001 From: soloseng <102702451+soloseng@users.noreply.github.com> Date: Mon, 23 Sep 2024 20:43:47 -0400 Subject: [PATCH] updated initialization check --- packages/protocol/contracts-0.8/common/EpochManager.sol | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/protocol/contracts-0.8/common/EpochManager.sol b/packages/protocol/contracts-0.8/common/EpochManager.sol index 5129a37304c..41eda20b93e 100644 --- a/packages/protocol/contracts-0.8/common/EpochManager.sol +++ b/packages/protocol/contracts-0.8/common/EpochManager.sol @@ -51,7 +51,7 @@ contract EpochManager is bool processed; uint256 epochRewards; } - + bool public isSystemInitialized; // the length of an epoch in seconds uint256 public epochDuration; @@ -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; @@ -376,7 +377,7 @@ contract EpochManager is } function systemAlreadyInitialized() public view returns (bool) { - return initialized && elected.length > 0; + return initialized && isSystemInitialized; } /**