Fix initialization race (#12374)

* block all the sync startup code on init signal

* don't need chainStarted if everything blocks

* set empty clock by default to work around panics

* remove unused clock, zero-value for init-sync

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: Nishant Das <nishdas93@gmail.com>
This commit is contained in:
kasey
2023-05-09 23:09:15 -05:00
committed by GitHub
parent 98f8ca4e34
commit 7d9f36985e
4 changed files with 2 additions and 5 deletions

View File

@@ -67,6 +67,7 @@ func NewService(ctx context.Context, cfg *Config) *Service {
chainStarted: abool.New(),
counter: ratecounter.NewRateCounter(counterSeconds * time.Second),
genesisChan: make(chan time.Time),
clock: startup.NewClock(time.Unix(0, 0), [32]byte{}), // default clock to prevent panic
}
return s