The sync committee duties loop now starts after fork info to be available (#4355)

This is needed because the service needs to call `forkAtEpoch()` as part
of its operation.
This commit is contained in:
zah 2022-11-25 00:19:58 +02:00 committed by GitHub
parent 04392c236b
commit 025c1a8b7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -413,6 +413,9 @@ proc mainLoop(service: SyncCommitteeServiceRef) {.async.} =
service.state = ServiceState.Running
debug "Service started"
debug "Sync committee duties loop waiting for fork schedule update"
await vc.forksAvailable.wait()
while true:
# This loop could look much more nicer/better, when
# https://github.com/nim-lang/Nim/issues/19911 will be fixed, so it could