We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6a145ea + cc24beb commit d2c5328Copy full SHA for d2c5328
loopd/migration.go
@@ -82,6 +82,17 @@ func needSqlMigration(cfg *Config) bool {
82
return false
83
}
84
85
+ // Do not migrate if sqlite db already exists. This is to prevent the
86
+ // migration from running multiple times for systems that may restore
87
+ // any deleted files occasionally (reboot, etc).
88
+ sqliteDBPath := filepath.Join(cfg.DataDir, "loop_sqlite.db")
89
+ if lnrpc.FileExists(sqliteDBPath) {
90
+ log.Infof("Found sqlite db at %v, skipping migration",
91
+ sqliteDBPath)
92
+
93
+ return false
94
+ }
95
96
// Now we'll check if the bolt db exists.
97
if !lnrpc.FileExists(filepath.Join(cfg.DataDir, "loop.db")) {
98
0 commit comments