Skip to content

Commit

Permalink
Only consider rewards if the position is not decayed in the current e…
Browse files Browse the repository at this point in the history
…poch (#751)
  • Loading branch information
bryzettler authored Dec 10, 2024
1 parent d18a545 commit 388ae85
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,19 @@ export const HeliumVsrStateProvider: React.FC<{
const delegatedSubDao = isDelegated
? delegatedAccounts[idx]?.info?.subDao
: null;

if (isDelegated) {
const epoch = delegatedAccounts[
idx
]!.info!.lastClaimedEpoch.add(new BN(1));

const epochsCount = isDecayed
? decayedEpoch.sub(epoch).add(new BN(1)).toNumber()
: currentEpoch.sub(epoch).toNumber();

hasRewards = epochsCount > 0;
hasRewards =
epochsCount > 0 &&
!(isDecayed && decayedEpoch.eq(currentEpoch));
}

const posVotingPower = calcPositionVotingPower({
Expand Down

0 comments on commit 388ae85

Please sign in to comment.