@@ -66,6 +66,12 @@ const (
66
66
MainnetServer = "autopilot.lightning.finance:12010"
67
67
TestnetServer = "test.autopilot.lightning.finance:12010"
68
68
69
+ // lndWalletReadyStatus is a custom status that will be used with the
70
+ // LND subserver. If the subserver is in this state then it will allow
71
+ // certain wallet calls through while denying other calls that require
72
+ // LND to be fully started.
73
+ lndWalletReadyStatus = "Wallet Ready"
74
+
69
75
defaultServerTimeout = 10 * time .Second
70
76
defaultConnectTimeout = 15 * time .Second
71
77
defaultStartupTimeout = 5 * time .Second
@@ -548,10 +554,9 @@ func (g *LightningTerminal) start() error {
548
554
err )
549
555
}
550
556
551
- // We can now set the status of LND as running.
552
- // This is done _before_ we wait for the macaroon so that
553
- // LND commands to create and unlock a wallet can be allowed.
554
- g .statusMgr .SetRunning (subservers .LND )
557
+ // We now set a custom status for the LND sub-server to indicate that
558
+ // the wallet is ready.
559
+ g .statusMgr .SetCustomStatus (subservers .LND , lndWalletReadyStatus )
555
560
556
561
// Now that we have started the main UI web server, show some useful
557
562
// information to the user so they can access the web UI easily.
@@ -619,6 +624,10 @@ func (g *LightningTerminal) start() error {
619
624
return fmt .Errorf ("could not start LND" )
620
625
}
621
626
627
+ // Mark that lnd is now completely running after connecting the
628
+ // lnd clients.
629
+ g .statusMgr .SetRunning (subservers .LND )
630
+
622
631
// If we're in integrated and stateless init mode, we won't create
623
632
// macaroon files in any of the subserver daemons.
624
633
createDefaultMacaroons := true
0 commit comments