Skip to content

Commit 5aabbde

Browse files
committed
lit: add a statelessInit bool in the config
So that it is easy to check elsewhere if we are in this mode.
1 parent 4bdde68 commit 5aabbde

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ type Config struct {
224224
poolRemote bool
225225
tapRemote bool
226226

227+
// Whether or not LND and LiT are running in stateless init mode.
228+
statelessInitMode bool
229+
227230
// lndAdminMacaroon is the admin macaroon that is given to us by lnd
228231
// over an in-memory connection on startup. This is only set in
229232
// integrated lnd mode.

terminal.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,6 @@ func (g *LightningTerminal) start() error {
680680

681681
// If we're in integrated and stateless init mode, we won't create
682682
// macaroon files in any of the subserver daemons.
683-
createDefaultMacaroons := true
684683
if g.cfg.LndMode == ModeIntegrated && g.lndInterceptorChain != nil &&
685684
g.lndInterceptorChain.MacaroonService() != nil {
686685

@@ -690,16 +689,16 @@ func (g *LightningTerminal) start() error {
690689
// daemons. In all other cases we want default macaroons so we
691690
// can use the CLI tools to interact with loop/pool/faraday.
692691
macService := g.lndInterceptorChain.MacaroonService()
693-
createDefaultMacaroons = !macService.StatelessInit
692+
g.cfg.statelessInitMode = macService.StatelessInit
694693
}
695694

696695
// Both connection types are ready now, let's start our sub-servers if
697696
// they should be started locally as an integrated service.
698697
g.subServerMgr.StartIntegratedServers(
699-
g.basicClient, g.lndClient, createDefaultMacaroons,
698+
g.basicClient, g.lndClient, !g.cfg.statelessInitMode,
700699
)
701700

702-
err = g.startInternalSubServers(createDefaultMacaroons)
701+
err = g.startInternalSubServers(!g.cfg.statelessInitMode)
703702
if err != nil {
704703
return fmt.Errorf("could not start litd sub-servers: %v", err)
705704
}

0 commit comments

Comments
 (0)