Skip to content

Commit

Permalink
Index active delegators properly (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfives authored Jun 4, 2024
1 parent 72696b4 commit 55660db
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ contract RewardsDistribution is
address[] memory delegators = IVotesEnumerable(sd.riverToken)
.getDelegatorsByDelegatee(operator);
address[] memory validDelegators = new address[](delegators.length);
uint256 activeDelegators = 0;
for (uint256 i = 0; i < delegators.length; i++) {
if (
_isActiveSinceLastCycle(
Expand All @@ -300,7 +301,8 @@ contract RewardsDistribution is
)
)
) {
validDelegators[i] = delegators[i];
validDelegators[activeDelegators] = delegators[i];
activeDelegators++;
}
}
return validDelegators;
Expand Down

0 comments on commit 55660db

Please sign in to comment.