diff --git a/cmd/mint/mint.go b/cmd/mint/mint.go index d5fbf71..25d6480 100644 --- a/cmd/mint/mint.go +++ b/cmd/mint/mint.go @@ -160,7 +160,7 @@ func configFromEnv() (*mint.Config, error) { return &mint.Config{ DerivationPathIdx: uint32(derivationPathIdx), Port: port, - MintPath: os.Getenv("MINT_DB_PATH"), + MintPath: mintPath, DBMigrationPath: "../../mint/storage/sqlite/migrations", InputFeePpk: inputFeePpk, MintInfo: mintInfo, diff --git a/wallet/wallet.go b/wallet/wallet.go index 8f2f2f3..adc3a8f 100644 --- a/wallet/wallet.go +++ b/wallet/wallet.go @@ -1760,6 +1760,10 @@ func Restore(walletPath, mnemonic string, mintsToRestore []string) (cashu.Proofs return nil, errors.New("wallet already exists") } + if err := os.MkdirAll(walletPath, 0700); err != nil { + return nil, err + } + // check mnemonic is valid if !bip39.IsMnemonicValid(mnemonic) { return nil, errors.New("invalid mnemonic")