mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 23:48:06 -05:00
Check if initial sync service has been initialized (#8214)
This commit is contained in:
@@ -127,7 +127,7 @@ func (s *Service) Stop() error {
|
||||
|
||||
// Status of initial sync.
|
||||
func (s *Service) Status() error {
|
||||
if s.synced.IsNotSet() && s.chainStarted.IsSet() {
|
||||
if s.Syncing() {
|
||||
return errors.New("syncing")
|
||||
}
|
||||
return nil
|
||||
@@ -138,6 +138,11 @@ func (s *Service) Syncing() bool {
|
||||
return s.synced.IsNotSet()
|
||||
}
|
||||
|
||||
// Initialized returns true if initial sync has been started.
|
||||
func (s *Service) Initialized() bool {
|
||||
return s.chainStarted.IsSet()
|
||||
}
|
||||
|
||||
// Resync allows a node to start syncing again if it has fallen
|
||||
// behind the current network head.
|
||||
func (s *Service) Resync() error {
|
||||
|
||||
Reference in New Issue
Block a user