File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import (
1818 litstatus "github.com/lightninglabs/lightning-terminal/status"
1919 "github.com/lightninglabs/lightning-terminal/subservers"
2020 "github.com/lightningnetwork/lnd/lncfg"
21+ "github.com/lightningnetwork/lnd/lnrpc"
2122 "github.com/lightningnetwork/lnd/macaroons"
2223 grpcProxy "github.com/mwitkow/grpc-proxy/proxy"
2324 "google.golang.org/grpc"
@@ -179,6 +180,10 @@ type rpcProxy struct {
179180
180181 lndConn * grpc.ClientConn
181182
183+ // basicClient is an interface to an LND node. Note that this may be nil
184+ // until it is set via setBasicLNDClient.
185+ basicClient lnrpc.LightningClient
186+
182187 grpcServer * grpc.Server
183188 grpcWebProxy * grpcweb.WrappedGrpcServer
184189}
@@ -211,6 +216,12 @@ func (p *rpcProxy) Stop() error {
211216 return nil
212217}
213218
219+ // setBasicLNDClient provides the rpcProxy with a connection to LND
220+ // implementing the lnrpc.LightningClient interface.
221+ func (p * rpcProxy ) setBasicLNDClient (client lnrpc.LightningClient ) {
222+ p .basicClient = client
223+ }
224+
214225// StopDaemon will send a shutdown request to the interrupt handler, triggering
215226// a graceful shutdown of the daemon.
216227//
Original file line number Diff line number Diff line change @@ -805,6 +805,7 @@ func (g *LightningTerminal) setUpLNDClients(lndQuit chan struct{}) error {
805805
806806 log .Infof ("Retrying to connect basic lnd client" )
807807 }
808+ g .rpcProxy .setBasicLNDClient (g .basicClient )
808809
809810 // Now we know that the connection itself is ready. But we also need to
810811 // wait for two things: The chain notifier to be ready and the lnd
You can’t perform that action at this time.
0 commit comments