We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b932eb commit 49ed205Copy full SHA for 49ed205
src/events/rewards/rewards.service.ts
@@ -136,7 +136,8 @@ export class RewardsService {
136
137
protected async getHoursAgoBlock(hours: number) {
138
const currentBlock = await this.provider.getBlockNumber();
139
- return currentBlock - Math.ceil((hours * 60 * 60) / SECONDS_PER_SLOT);
+ const blockInPast = currentBlock - Math.ceil((hours * 60 * 60) / SECONDS_PER_SLOT);
140
+ return Math.max(blockInPast, 0);
141
}
142
143
protected async getElRewards(fromBlock: number): Promise<BigNumber> {
0 commit comments