mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-18 13:09:19 +02:00
terminal: create sqlite db directory from configured path
Create the SQLite database directory from c.Sqlite.DatabaseFileName instead of the generic network directory. This ensures startup uses the final validated SQLite path, including cases where loadAndValidateConfig has already overridden the database file location to point at the correct network-specific directory.
This commit is contained in:
parent
c5ec8703d4
commit
d2bbd18fee
1 changed files with 4 additions and 1 deletions
|
|
@ -299,7 +299,10 @@ func (c *Config) NewStores(ctx context.Context,
|
|||
case DatabaseBackendSqlite:
|
||||
// Before we initialize the SQLite store, we'll make sure that
|
||||
// the directory where we will store the database file exists.
|
||||
err := makeDirectories(networkDir)
|
||||
// Note that the c.Sqlite.DatabaseFileName may already have
|
||||
// overwritten in loadAndValidateConfig, so that the correct
|
||||
// network folder has been chosen.
|
||||
err := makeDirectories(filepath.Dir(c.Sqlite.DatabaseFileName))
|
||||
if err != nil {
|
||||
return stores, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue