Skip to content

Commit

Permalink
fix bug missing data/chain for temp backup file
Browse files Browse the repository at this point in the history
  • Loading branch information
dkoukoul committed Jan 17, 2022
1 parent f39d8d0 commit 2a39499
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lnd/chanbackup/backupfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ func NewMultiFile(fileName string) *MultiFile {
// We'll our temporary backup file in the very same directory as the
// main backup file.
backupFileDir := filepath.Dir(fileName)
//Check if folder exists
_, err := os.Stat(backupFileDir)
if os.IsNotExist(err) {
if err := os.MkdirAll(backupFileDir, 0700); err != nil {
log.Errorf("unable to create folder %s", backupFileDir)
return nil
}
}

tempFileName := filepath.Join(
backupFileDir, DefaultTempBackupFileName,
)
Expand Down

0 comments on commit 2a39499

Please sign in to comment.