Submitted by pkqs90, also found by pkqs90, hash (1, 2), and novamanbg
When calculating the endRewardTime, there is a cache mechanism that caches the result for endingTime.updateCadence (in UT it is set to 2 days). However, during this period, if anything changes, the endRewardTime would be incorrect. For example:
If the cached endRewardTime is smaller than expected, this will cause the rewards to be not distributed for the time period.
If the cached endRewardTime is larger than expected, the some pools may receive rewards after when they should, causing less rewards for other pools.
Always recalculate for endRewardTime() and remove the cache. This is acceptable, because the _updatePool() function is only called upon user interactions, and not called regularly, so it is not requried to save gas here.
amarcu (LoopFi) confirmed
