Skip to content

Commit

Permalink
fixes: pass mint path in config and create wallet dir in restore
Browse files Browse the repository at this point in the history
  • Loading branch information
elnosh committed Oct 30, 2024
1 parent 0afd1b7 commit 4b4765e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/mint/mint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 4b4765e

Please sign in to comment.