@@ -56,9 +56,8 @@ func openDatabase(cfg *Config, chainParams *chaincfg.Params) (loopdb.SwapStore,
5656 case DatabaseBackendSqlite :
5757 log .Infof ("Opening sqlite3 database at: %v" ,
5858 cfg .Sqlite .DatabaseFileName )
59- db , err = loopdb .NewSqliteStore (
60- cfg .Sqlite , chainParams ,
61- )
59+
60+ db , err = loopdb .NewSqliteStore (cfg .Sqlite , chainParams )
6261 if err != nil {
6362 return nil , nil , err
6463 }
@@ -67,9 +66,8 @@ func openDatabase(cfg *Config, chainParams *chaincfg.Params) (loopdb.SwapStore,
6766 case DatabaseBackendPostgres :
6867 log .Infof ("Opening postgres database at: %v" ,
6968 cfg .Postgres .DSN (true ))
70- db , err = loopdb .NewPostgresStore (
71- cfg .Postgres , chainParams ,
72- )
69+
70+ db , err = loopdb .NewPostgresStore (cfg .Postgres , chainParams )
7371 if err != nil {
7472 return nil , nil , err
7573 }
@@ -79,9 +77,6 @@ func openDatabase(cfg *Config, chainParams *chaincfg.Params) (loopdb.SwapStore,
7977 return nil , nil , fmt .Errorf ("unknown database backend: %s" ,
8078 cfg .DatabaseBackend )
8179 }
82- if err != nil {
83- return nil , nil , fmt .Errorf ("unable to open database: %v" , err )
84- }
8580
8681 return db , & baseDb , nil
8782}
0 commit comments