Do not fetch validator status twice on startup

This commit is contained in:
Jim McDonald 2020-09-30 13:24:42 +01:00
parent 8d29b15618
commit cfbe1726da
No known key found for this signature in database
GPG Key ID: 89CEB61B2AD2A5E7
2 changed files with 10 additions and 5 deletions

View File

@ -1,6 +1,7 @@
Development
- do not continue if attempt to acquire a semaphore fails
- fetch validators without balances, for (much) faster response from Prysm
- do not fetch validator status twice on startup
0.6.1
- update documentation for account managers, explaining the difference between Dirk and wallet

View File

@ -216,11 +216,15 @@ func (s *Service) epochTicker(ctx context.Context, data interface{}) {
// Wait for half a second for the beacon node to update.
time.Sleep(500 * time.Millisecond)
log.Trace().Msg("Updating validating accounts")
err := s.validatingAccountsProvider.(accountmanager.AccountsUpdater).UpdateAccountsState(ctx)
if err != nil {
log.Warn().Err(err).Msg("Failed to update account state")
// Don't return even though we have an error here, as we can continue with the accounts we have from the previous run.
// Do not update on first run because the service fetches accounts on startup.
if !firstRun {
log.Trace().Msg("Updating validating accounts")
err := s.validatingAccountsProvider.(accountmanager.AccountsUpdater).UpdateAccountsState(ctx)
if err != nil {
log.Warn().Err(err).Msg("Failed to update account state")
// Don't return even though we have an error here, as we can continue with the accounts we have from the previous run.
}
log.Trace().Msg("Updated validating accounts")
}
accounts, err := s.validatingAccountsProvider.Accounts(ctx)
if err != nil {