Skip to content

Commit aac270d

Browse files
committed
validate fee receivers: re-select access node on each retry
1 parent c220b1f commit aac270d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

api/validate.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ func (s *Server) validateFeeReceivers(ctx context.Context) {
2121
if s.Offline {
2222
return
2323
}
24-
client := s.DataAccessNodes.Client()
2524
const attempts = 5
2625
for attempt := 1; attempt <= attempts; attempt++ {
2726
select {
@@ -32,6 +31,9 @@ func (s *Server) validateFeeReceivers(ctx context.Context) {
3231
if attempt > 1 {
3332
time.Sleep(time.Duration(attempt) * time.Second)
3433
}
34+
// Pick a client on each attempt so a retry can land on a different
35+
// access node if the previously selected one is unavailable.
36+
client := s.DataAccessNodes.Client()
3537
latest, err := client.LatestBlockHeader(ctx)
3638
if err != nil {
3739
log.Errorf("Failed to get the latest block header to validate fee receivers: %s", err)

0 commit comments

Comments
 (0)