mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-26 00:31:04 +01:00
chainregistry: properly close neutrino database upon errors
This commit is contained in:
parent
e147445c08
commit
62d716d3c3
1 changed files with 2 additions and 0 deletions
|
@ -713,6 +713,7 @@ func initNeutrinoBackend(chainDir string) (*neutrino.ChainService, func(), error
|
|||
cfg.NeutrinoMode.AssertFilterHeader,
|
||||
)
|
||||
if err != nil {
|
||||
db.Close()
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
|
@ -754,6 +755,7 @@ func initNeutrinoBackend(chainDir string) (*neutrino.ChainService, func(), error
|
|||
|
||||
neutrinoCS, err := neutrino.NewChainService(config)
|
||||
if err != nil {
|
||||
db.Close()
|
||||
return nil, nil, fmt.Errorf("unable to create neutrino light "+
|
||||
"client: %v", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue