66 "encoding/base64"
77 "errors"
88 "fmt"
9+ "github.com/lightningnetwork/lnd/lncfg"
910 "io/ioutil"
1011 "net"
1112 "net/http"
@@ -22,7 +23,6 @@ import (
2223 "github.com/lightninglabs/loop/loopd"
2324 "github.com/lightninglabs/loop/looprpc"
2425 "github.com/lightningnetwork/lnd"
25- "github.com/lightningnetwork/lnd/lncfg"
2626 "github.com/lightningnetwork/lnd/lnrpc"
2727 "github.com/lightningnetwork/lnd/lntest/wait"
2828 "github.com/lightningnetwork/lnd/macaroons"
@@ -100,7 +100,19 @@ func (g *Shushtar) Run() error {
100100 return err
101101 }
102102
103+ // Load the configuration, and parse any command line options. This
104+ // function will also set up logging properly.
105+ g .cfg .Lnd , err = loadLndConfig (g .cfg )
106+ if err != nil {
107+ return err
108+ }
109+
103110 // Validate the shushtar config options.
111+ if g .cfg .LetsEncryptDir == "" {
112+ g .cfg .LetsEncryptDir = filepath .Join (
113+ g .cfg .Lnd .LndDir , defaultLetsEncryptDir ,
114+ )
115+ }
104116 g .cfg .LetsEncryptDir = lncfg .CleanAndExpandPath (g .cfg .LetsEncryptDir )
105117 if g .cfg .LetsEncrypt && g .cfg .LetsEncryptHost == "" {
106118 return fmt .Errorf ("host must be set when using let's encrypt" )
@@ -113,14 +125,7 @@ func (g *Shushtar) Run() error {
113125 return fmt .Errorf ("please set a strong password for the UI, " +
114126 "at least %d characters long" , uiPasswordMinLength )
115127 }
116-
117- // Load the configuration, and parse any command line options. This
118- // function will also set up logging properly.
119- g .cfg .Lnd , err = loadLndConfig (g .cfg )
120- if err != nil {
121- return err
122- }
123-
128+
124129 // Initiate our listeners. For now, we only support listening on one
125130 // port at a time because we can only pass in one pre-configured RPC
126131 // listener into lnd.
0 commit comments