Report sync unhealthy in the case that the node is still syncing initially (#3623)

This commit is contained in:
Preston Van Loon 2019-09-27 12:30:28 -07:00 committed by GitHub
parent 24df2d3e44
commit 59b4ade50b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ import (
"sync"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/pkg/errors"
"github.com/prysmaticlabs/prysm/beacon-chain/blockchain"
"github.com/prysmaticlabs/prysm/beacon-chain/db"
"github.com/prysmaticlabs/prysm/beacon-chain/operations"
@ -84,6 +85,9 @@ func (r *RegularSync) Stop() error {
// Status of the currently running regular sync service.
func (r *RegularSync) Status() error {
if r.initialSync.Syncing(){
return errors.New("waiting for initial sync")
}
return nil
}