Skip to content

Commit

Permalink
Fix notification end of api call instead of per validator (#634)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferranbt authored Jul 5, 2024
1 parent ce5ca39 commit 17f680e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions services/api/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -1122,12 +1122,6 @@ func (api *RelayAPI) handleRegisterValidator(w http.ResponseWriter, req *http.Re
default:
regLog.Error("validator registration channel full")
}

// notify of a new validator
select {
case api.validatorUpdateCh <- struct{}{}:
default:
}
})

log = log.WithFields(logrus.Fields{
Expand All @@ -1145,6 +1139,12 @@ func (api *RelayAPI) handleRegisterValidator(w http.ResponseWriter, req *http.Re
return
}

// notify that new registrations are available
select {
case api.validatorUpdateCh <- struct{}{}:
default:
}

log.Info("validator registrations call processed")
w.WriteHeader(http.StatusOK)
}
Expand Down

0 comments on commit 17f680e

Please sign in to comment.