From 56ab811f62f0326f9ca2e7f89b5308ebd2af5390 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 2 May 2019 17:33:32 -0700 Subject: [PATCH] lndclient: modify basic_client.go to use the mac dir rather than path --- lndclient/basic_client.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lndclient/basic_client.go b/lndclient/basic_client.go index 989b053..ccfd457 100644 --- a/lndclient/basic_client.go +++ b/lndclient/basic_client.go @@ -17,7 +17,7 @@ import ( // "basic" as it uses a global macaroon (by default the admin macaroon) for the // entire connection, and falls back to expected defaults if the arguments // aren't provided. -func NewBasicClient(lndHost, tlsPath, macPath, network string) (lnrpc.LightningClient, error) { +func NewBasicClient(lndHost, tlsPath, macDir, network string) (lnrpc.LightningClient, error) { if tlsPath == "" { tlsPath = defaultTLSCertPath } @@ -33,13 +33,15 @@ func NewBasicClient(lndHost, tlsPath, macPath, network string) (lnrpc.LightningC grpc.WithTransportCredentials(creds), } - if macPath == "" { - macPath = filepath.Join( + if macDir == "" { + macDir = filepath.Join( defaultLndDir, defaultDataDir, defaultChainSubDir, - "bitcoin", network, defaultAdminMacaroonFilename, + "bitcoin", network, ) } + macPath := filepath.Join(macDir, defaultAdminMacaroonFilename) + // Load the specified macaroon file. macBytes, err := ioutil.ReadFile(macPath) if err == nil {