Skip to content

Commit

Permalink
add check on isParticipatingInUpcomingRound
Browse files Browse the repository at this point in the history
  • Loading branch information
0xCardinalError committed Sep 9, 2024
1 parent e70c3cd commit 451e2a4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Redistribution.sol
Original file line number Diff line number Diff line change
Expand Up @@ -801,11 +801,13 @@ contract Redistribution is AccessControl, Pausable {
* @param _depth The storage depth the applicant intends to report.
*/
function isParticipatingInUpcomingRound(address _owner, uint8 _depth) public view returns (bool) {
uint256 _lastUpdate = Stakes.lastUpdatedBlockNumberOfAddress(_owner);

if (currentPhaseReveal()) {
revert WrongPhase();
}

if (Stakes.lastUpdatedBlockNumberOfAddress(_owner) >= block.number - 2 * ROUND_LENGTH) {
if (_lastUpdate >= block.number - 2 * ROUND_LENGTH && _lastUpdate > 0) {
revert MustStake2Rounds();
}

Expand Down

0 comments on commit 451e2a4

Please sign in to comment.