Skip to content

Commit 56ab811

Browse files
committed
lndclient: modify basic_client.go to use the mac dir rather than path
1 parent 52dbc03 commit 56ab811

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lndclient/basic_client.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
// "basic" as it uses a global macaroon (by default the admin macaroon) for the
1818
// entire connection, and falls back to expected defaults if the arguments
1919
// aren't provided.
20-
func NewBasicClient(lndHost, tlsPath, macPath, network string) (lnrpc.LightningClient, error) {
20+
func NewBasicClient(lndHost, tlsPath, macDir, network string) (lnrpc.LightningClient, error) {
2121
if tlsPath == "" {
2222
tlsPath = defaultTLSCertPath
2323
}
@@ -33,13 +33,15 @@ func NewBasicClient(lndHost, tlsPath, macPath, network string) (lnrpc.LightningC
3333
grpc.WithTransportCredentials(creds),
3434
}
3535

36-
if macPath == "" {
37-
macPath = filepath.Join(
36+
if macDir == "" {
37+
macDir = filepath.Join(
3838
defaultLndDir, defaultDataDir, defaultChainSubDir,
39-
"bitcoin", network, defaultAdminMacaroonFilename,
39+
"bitcoin", network,
4040
)
4141
}
4242

43+
macPath := filepath.Join(macDir, defaultAdminMacaroonFilename)
44+
4345
// Load the specified macaroon file.
4446
macBytes, err := ioutil.ReadFile(macPath)
4547
if err == nil {

0 commit comments

Comments
 (0)