Skip to content

Commit d1e7695

Browse files
committed
terminal: move the location where statelessInitMode is set
So that it is set correctly by the time we potentially want to special case the handling of the bakesupermacaroon method. This is required in the case where the full LND connection takes long to create due to it blocking on LND being fully synced.
1 parent 6bcf19f commit d1e7695

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

terminal.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -682,20 +682,6 @@ func (g *LightningTerminal) start() error {
682682
// lnd clients.
683683
g.statusMgr.SetRunning(subservers.LND)
684684

685-
// If we're in integrated and stateless init mode, we won't create
686-
// macaroon files in any of the subserver daemons.
687-
if g.cfg.LndMode == ModeIntegrated && g.lndInterceptorChain != nil &&
688-
g.lndInterceptorChain.MacaroonService() != nil {
689-
690-
// If the wallet was initialized in stateless mode, we don't
691-
// want any macaroons lying around on the filesystem. In that
692-
// case only the UI will be able to access any of the integrated
693-
// daemons. In all other cases we want default macaroons so we
694-
// can use the CLI tools to interact with loop/pool/faraday.
695-
macService := g.lndInterceptorChain.MacaroonService()
696-
g.cfg.statelessInitMode = macService.StatelessInit
697-
}
698-
699685
// Both connection types are ready now, let's start our sub-servers if
700686
// they should be started locally as an integrated service.
701687
createDefaultMacaroons := !g.cfg.statelessInitMode
@@ -821,6 +807,20 @@ func (g *LightningTerminal) setUpLNDClients(lndQuit chan struct{}) error {
821807
}
822808
g.basicClientSet.Store(true)
823809

810+
// If we're in integrated and stateless init mode, we won't create
811+
// macaroon files in any of the subserver daemons.
812+
if g.cfg.LndMode == ModeIntegrated && g.lndInterceptorChain != nil &&
813+
g.lndInterceptorChain.MacaroonService() != nil {
814+
815+
// If the wallet was initialized in stateless mode, we don't
816+
// want any macaroons lying around on the filesystem. In that
817+
// case only the UI will be able to access any of the integrated
818+
// daemons. In all other cases we want default macaroons so we
819+
// can use the CLI tools to interact with loop/pool/faraday.
820+
macService := g.lndInterceptorChain.MacaroonService()
821+
g.cfg.statelessInitMode = macService.StatelessInit
822+
}
823+
824824
// Now we know that the connection itself is ready. But we also need to
825825
// wait for two things: The chain notifier to be ready and the lnd
826826
// wallet being fully synced to its chain backend. The chain notifier

0 commit comments

Comments
 (0)