Skip to content

Commit cde07b5

Browse files
committed
terminal: add basic lnd client to LightningTerminal struct
Add basic lnd client to LightningTerminal struct since it is needed anytime we want to call `BackeMacaroon`.
1 parent 159bf07 commit cde07b5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

terminal.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ type LightningTerminal struct {
141141
wg sync.WaitGroup
142142
lndErrChan chan error
143143

144-
lndClient *lndclient.GrpcLndServices
144+
lndClient *lndclient.GrpcLndServices
145+
basicClient lnrpc.LightningClient
145146

146147
faradayServer *frdrpc.RPCServer
147148
faradayStarted bool
@@ -406,7 +407,6 @@ func (g *LightningTerminal) Run() error {
406407
// servers that lnd started.
407408
func (g *LightningTerminal) startSubservers() error {
408409
var (
409-
basicClient lnrpc.LightningClient
410410
insecure bool
411411
clientOptions []lndclient.BasicClientOption
412412
)
@@ -438,7 +438,7 @@ func (g *LightningTerminal) startSubservers() error {
438438
// We'll need a basic client and a full client because not all
439439
// subservers have the same requirements.
440440
var err error
441-
basicClient, err = lndclient.NewBasicClient(
441+
g.basicClient, err = lndclient.NewBasicClient(
442442
host, tlsPath, path.Dir(macPath), string(network),
443443
clientOptions...,
444444
)
@@ -498,7 +498,7 @@ func (g *LightningTerminal) startSubservers() error {
498498
// faraday, loop, and pool, all at the same time.
499499
ctx := context.Background()
500500
superMacaroon, err := bakeSuperMacaroon(
501-
ctx, basicClient, 0, getAllPermissions(), nil,
501+
ctx, g.basicClient, 0, getAllPermissions(), nil,
502502
)
503503
if err != nil {
504504
return err
@@ -546,7 +546,7 @@ func (g *LightningTerminal) startSubservers() error {
546546

547547
if !g.cfg.poolRemote {
548548
err = g.poolServer.StartAsSubserver(
549-
basicClient, g.lndClient, createDefaultMacaroons,
549+
g.basicClient, g.lndClient, createDefaultMacaroons,
550550
)
551551
if err != nil {
552552
return err

0 commit comments

Comments
 (0)