Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Commit 9cf7b38

Browse files
committed
Check if requested epoch is pruned
1 parent f6cef02 commit 9cf7b38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/restapi/core/accounts.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ func validators(c echo.Context) (*api.ValidatorsResponse, error) {
7373
}
7474
}
7575

76-
if requestedEpoch > currentEpoch {
77-
return nil, ierrors.Wrapf(echo.ErrBadRequest, "epoch %d is larger than current epoch %d", requestedEpoch, currentEpoch)
76+
if requestedEpoch > currentEpoch || requestedEpoch <= deps.RequestHandler.GetNodeStatus().PruningEpoch {
77+
return nil, ierrors.Wrapf(echo.ErrBadRequest, "epoch %d is larger than current epoch or already pruned", requestedEpoch)
7878
}
7979

8080
return deps.RequestHandler.Validators(requestedEpoch, cursorIndex, pageSize)

0 commit comments

Comments
 (0)