Revert changes to sync service status check (#8215)

This commit is contained in:
Radosław Kapka 2021-01-06 12:19:53 +01:00 committed by GitHub
parent 7135a8542f
commit 392e61fbee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -127,7 +127,7 @@ func (s *Service) Stop() error {
// Status of initial sync.
func (s *Service) Status() error {
if s.Syncing() {
if s.synced.IsNotSet() && s.chainStarted.IsSet() {
return errors.New("syncing")
}
return nil

View File

@ -327,9 +327,8 @@ func TestService_markSynced(t *testing.T) {
assert.Equal(t, false, s.chainStarted.IsSet())
assert.Equal(t, false, s.synced.IsSet())
assert.Equal(t, true, s.Syncing())
assert.ErrorContains(t, "syncing", s.Status())
assert.NoError(t, s.Status())
s.chainStarted.Set()
assert.Equal(t, true, s.Syncing())
assert.ErrorContains(t, "syncing", s.Status())
expectedGenesisTime := time.Unix(358544700, 0)
@ -360,7 +359,6 @@ func TestService_markSynced(t *testing.T) {
}
assert.Equal(t, expectedGenesisTime, receivedGenesisTime)
assert.Equal(t, false, s.Syncing())
assert.NoError(t, s.Status())
}
func TestService_Resync(t *testing.T) {