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 committed 2020-09-25 15:54:10 +02:00
1 parent 44524fd2e5
commit b28bf29c5f
3 files changed
+37 -23

No files matched your search

+1 -1
View File
@@ -70,7 +70,7 @@ func getClient(ctx *cli.Context) (lnrpc.LightningClient, func()) {
func getClientConn(ctx *cli.Context, skipMacaroons bool) *grpc.ClientConn {
// First, we'll get the selected stored profile or an ephemeral one
// created from the global options in the CLI context.
profile, err := getGlobalOptions(ctx)
profile, err := getGlobalOptions(ctx, skipMacaroons)
if err != nil {
fatal(fmt.Errorf("could not load global options: %v", err))
}