Skip to content

Commit

Permalink
renamed swap database directory (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimalinux authored Jun 7, 2023
1 parent 584858f commit c3cce99
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion daemon/swap_daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/default-file-locations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c3cce99

Please sign in to comment.