mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 19:40:37 +00:00
parent
2b40c44879
commit
113172d8aa
@ -89,6 +89,12 @@ func (s *Service) Start() {
|
||||
log.Debug("Exiting Initial Sync Service")
|
||||
return
|
||||
}
|
||||
// Exit entering round-robin sync if we require 0 peers to sync.
|
||||
if flags.Get().MinimumSyncPeers == 0 {
|
||||
s.markSynced()
|
||||
log.WithField("genesisTime", gt).Info("Due to number of peers required for sync being set at 0, entering regular sync immediately.")
|
||||
return
|
||||
}
|
||||
if gt.After(prysmTime.Now()) {
|
||||
s.markSynced()
|
||||
log.WithField("genesisTime", gt).Info("Genesis time has not arrived - not syncing")
|
||||
|
@ -31,6 +31,14 @@ func TestService_Constants(t *testing.T) {
|
||||
|
||||
func TestService_InitStartStop(t *testing.T) {
|
||||
hook := logTest.NewGlobal()
|
||||
resetFlags := flags.Get()
|
||||
flags.Init(&flags.GlobalFlags{
|
||||
MinimumSyncPeers: 1,
|
||||
})
|
||||
defer func() {
|
||||
flags.Init(resetFlags)
|
||||
}()
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
assert func()
|
||||
|
Loading…
Reference in New Issue
Block a user