This commit is contained in:
Dan Laine 2020-06-30 16:55:05 -04:00
parent d3a4dcffef
commit 1d2e1eb00e
1 changed files with 3 additions and 6 deletions

View File

@ -511,20 +511,17 @@ func (n *Node) initHealthAPI() error {
return fmt.Errorf("couldn't register heartbeat health check: %w", err)
}
isBootstrappedFunc := func() (interface{}, error) {
pChainID, err := n.chainManager.Lookup("P")
if err != nil {
if pChainID, err := n.chainManager.Lookup("P"); err != nil {
return nil, errors.New("P-Chain not created")
} else if !n.chainManager.IsBootstrapped(pChainID) {
return nil, errors.New("P-Chain not bootstrapped")
}
xChainID, err := n.chainManager.Lookup("X")
if err != nil {
if xChainID, err := n.chainManager.Lookup("X"); err != nil {
return nil, errors.New("X-Chain not created")
} else if !n.chainManager.IsBootstrapped(xChainID) {
return nil, errors.New("X-Chain not bootstrapped")
}
cChainID, err := n.chainManager.Lookup("C")
if err != nil {
if cChainID, err := n.chainManager.Lookup("C"); err != nil {
return nil, errors.New("C-Chain not created")
} else if !n.chainManager.IsBootstrapped(cChainID) {
return nil, errors.New("C-Chain not bootstrapped")