Fix rpcdaemon: borDb may be nil (#3512)

This commit is contained in:
Andrew Ashikhmin 2022-02-14 13:00:54 +01:00 committed by GitHub
parent 83c99d66da
commit b3905fb659
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,9 @@ func main() {
return nil
}
defer db.Close()
defer borDb.Close()
if borDb != nil {
defer borDb.Close()
}
apiList := commands.APIList(db, borDb, backend, txPool, mining, starknet, ff, stateCache, blockReader, *cfg, nil)
if err := cli.StartRpcServer(ctx, *cfg, apiList); err != nil {