From bc8e9641b88218ee5b1b7e9311be873d991d7da8 Mon Sep 17 00:00:00 2001 From: shark0der Date: Tue, 4 Oct 2022 16:08:08 +0300 Subject: [PATCH] Fix update tranches never performing updates --- contracts/modules/staking/StakingPool.sol | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/contracts/modules/staking/StakingPool.sol b/contracts/modules/staking/StakingPool.sol index 43a0849cfb..47d08ea1ba 100644 --- a/contracts/modules/staking/StakingPool.sol +++ b/contracts/modules/staking/StakingPool.sol @@ -214,9 +214,10 @@ contract StakingPool is IStakingPool, ERC721 { uint currentBucketId = block.timestamp / BUCKET_DURATION; uint currentTrancheId = block.timestamp / TRANCHE_DURATION; - // skip if the pool is new + // if the pool is new if (_firstActiveBucketId == 0) { - return; + _firstActiveBucketId = currentBucketId; + _firstActiveTrancheId = currentTrancheId; } // if a force update was not requested @@ -246,9 +247,7 @@ contract StakingPool is IStakingPool, ERC721 { } if (_rewardsSharesSupply == 0) { - // nothing to do - firstActiveBucketId = currentBucketId; - firstActiveTrancheId = currentTrancheId; + // nothing to do, just update lastAccNxmUpdate lastAccNxmUpdate = block.timestamp; return; }