lncli: don't read macaroons when not using them

When we either don't use macaroons (because the global --no-macaroons
flag is set) or don't need them (for the wallet unlocker commands), we
don't try to read the file at all to avoid running into an error if the
file doesn't exist (which it doesn't in those two cases).
This commit is contained in:
Oliver Gugger
2020-09-25 15:38:40 +02:00
parent 44524fd2e5
commit b28bf29c5f
3 changed files with 37 additions and 23 deletions

View File

@@ -117,7 +117,7 @@ func profileAdd(ctx *cli.Context) error {
}
// Create a profile struct from all the global options.
profile, err := profileFromContext(ctx, true)
profile, err := profileFromContext(ctx, true, false)
if err != nil {
return fmt.Errorf("could not load global options: %v", err)
}