diff --git a/daemon/swap_daemon.go b/daemon/swap_daemon.go index e2c00ab0..9bf9008e 100644 --- a/daemon/swap_daemon.go +++ b/daemon/swap_daemon.go @@ -29,6 +29,12 @@ import ( "github.com/athanorlabs/atomic-swap/rpc" ) +const ( + // databaseDirName is the name of the folder, located in the swapd's + // data-dir, for the current and past swap information. + databaseDirName = "swap-db" +) + var log = logging.Logger("daemon") // SwapdConfig provides startup parameters for swapd. @@ -63,7 +69,7 @@ func RunSwapDaemon(ctx context.Context, conf *SwapdConfig) (err error) { // Initialize the database first, so the defer statement that closes it // will get executed last. sdb, err := db.NewDatabase(&chaindb.Config{ - DataDir: path.Join(conf.EnvConf.DataDir, "db"), + DataDir: path.Join(conf.EnvConf.DataDir, databaseDirName), }) if err != nil { return err diff --git a/docs/default-file-locations.md b/docs/default-file-locations.md index ad684f91..fc1ebf0d 100644 --- a/docs/default-file-locations.md +++ b/docs/default-file-locations.md @@ -13,7 +13,7 @@ and `ENV` is the value from the `--env` flag (e.g. `stagenet`, `mainnet`). From here forward, we will use `{DATA_DIR}` to refer to this default value or the value passed with the `--data-dir` flag. -### {DATA_DIR}/db +### {DATA_DIR}/swap-db This is the location of swapd's (BadgerDB) database. Currently, it stores offers made so that they can be reloaded on restart. The database can be safely deleted if you don't have any offers