Skip to content

Commit e76a7b5

Browse files
committed
fix: fixed not found last withdrawal
1 parent 2445fe0 commit e76a7b5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/jobs/validators/validators.service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ export class ValidatorsService {
178178

179179
protected async getLastWithdrawalValidatorIndex() {
180180
const withdrawals = await this.executionProviderService.getLatestWithdrawals();
181-
return BigNumber.from(withdrawals[withdrawals.length - 1].validatorIndex);
181+
const lastWithdrawal = withdrawals[withdrawals.length - 1];
182+
183+
this.logger.log('Found last withdrawal', { lastWithdrawal });
184+
return BigNumber.from(lastWithdrawal ? lastWithdrawal.validatorIndex : 0);
182185
}
183186

184187
protected logAnalyticsAboutWithdrawableBalances(activeValidatorCount: number, latestEpoch: string) {

0 commit comments

Comments
 (0)