@@ -56,9 +56,8 @@ func openDatabase(cfg *Config, chainParams *chaincfg.Params) (loopdb.SwapStore,
56
56
case DatabaseBackendSqlite :
57
57
log .Infof ("Opening sqlite3 database at: %v" ,
58
58
cfg .Sqlite .DatabaseFileName )
59
- db , err = loopdb .NewSqliteStore (
60
- cfg .Sqlite , chainParams ,
61
- )
59
+
60
+ db , err = loopdb .NewSqliteStore (cfg .Sqlite , chainParams )
62
61
if err != nil {
63
62
return nil , nil , err
64
63
}
@@ -67,9 +66,8 @@ func openDatabase(cfg *Config, chainParams *chaincfg.Params) (loopdb.SwapStore,
67
66
case DatabaseBackendPostgres :
68
67
log .Infof ("Opening postgres database at: %v" ,
69
68
cfg .Postgres .DSN (true ))
70
- db , err = loopdb .NewPostgresStore (
71
- cfg .Postgres , chainParams ,
72
- )
69
+
70
+ db , err = loopdb .NewPostgresStore (cfg .Postgres , chainParams )
73
71
if err != nil {
74
72
return nil , nil , err
75
73
}
@@ -79,9 +77,6 @@ func openDatabase(cfg *Config, chainParams *chaincfg.Params) (loopdb.SwapStore,
79
77
return nil , nil , fmt .Errorf ("unknown database backend: %s" ,
80
78
cfg .DatabaseBackend )
81
79
}
82
- if err != nil {
83
- return nil , nil , fmt .Errorf ("unable to open database: %v" , err )
84
- }
85
80
86
81
return db , & baseDb , nil
87
82
}
0 commit comments