Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Fix indexing gets stuck when self stake is set to zero
Browse files Browse the repository at this point in the history
  • Loading branch information
priojeetpriyom committed Dec 19, 2023
1 parent c583a20 commit 77a1954
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions services/blockchain-indexer/shared/indexer/utils/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ const calcSelfStakeReward = async (generatorAddress, blockReward, commissionAmou
{ amount: BigInt('0') },
);

// Return commission as 0 if self stake is 0
if (selfStakes <= 0) {
return BigInt('0');
}

const selfStakesQ = q96(selfStakes);
const totalStakesQ = q96(totalStakes);
const blockRewardQ = q96(blockReward);
Expand Down

0 comments on commit 77a1954

Please sign in to comment.