chainregistry: only stop ChainService after successful start
This commit is contained in:
parent
1fea5b09b2
commit
9e67f25957
@ -730,14 +730,15 @@ func initNeutrinoBackend(chainDir string) (*neutrino.ChainService, func(), error
|
||||
"client: %v", err)
|
||||
}
|
||||
|
||||
if err := neutrinoCS.Start(); err != nil {
|
||||
db.Close()
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
cleanUp := func() {
|
||||
db.Close()
|
||||
neutrinoCS.Stop()
|
||||
}
|
||||
if err := neutrinoCS.Start(); err != nil {
|
||||
cleanUp()
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
return neutrinoCS, cleanUp, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user