Do not error if dcrctl can't find dcrd.conf.

Closes #303
This commit is contained in:
John C. Vernaleo 2016-09-08 11:29:48 -04:00
parent 9e2a8e1f0c
commit 1001c19da0

View File

@ -286,11 +286,12 @@ func createDefaultConfigFile(destinationPath string) error {
return err
}
// Read dcrd.conf from its default path.
// Read dcrd.conf from its default path. If no dcrd.conf then just give
// up but do not error (since it is not an error to not have a dcrd.conf).
dcrdConfigPath := filepath.Join(dcrdHomeDir, "dcrd.conf")
dcrdConfigFile, err := os.Open(dcrdConfigPath)
if err != nil {
return err
return nil
}
defer dcrdConfigFile.Close()
content, err := ioutil.ReadAll(dcrdConfigFile)