mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
lndclient: modify basic_client.go to use the mac dir rather than path
This commit is contained in:
parent
52dbc03dda
commit
56ab811f62
1 changed files with 6 additions and 4 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue