chore: refactor DB closure to check for errors before returning (#4808)

This commit is contained in:
frank 2024-02-27 07:03:57 +08:00 committed by GitHub
parent 2445cda3e0
commit fca6cafc44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -477,12 +477,12 @@ func (n *StatusNode) stop() error {
n.downloader = nil
if n.db != nil {
err := n.db.Close()
n.db = nil
if err = n.db.Close(); err != nil {
n.log.Error("Error closing the leveldb of status node", "error", err)
return err
}
n.db = nil
}
n.rpcFiltersSrvc = nil
n.subscriptionsSrvc = nil