lnd+cmd/lnd/main: add ListenerCfg to Main

ListenerCfg allows passing custom listeners to the main method, to be
used for the wallet unlocker and rpc server. If these are set these will
be used instead of the regular RPC listeners.
This commit is contained in:
Johan T. Halseth
2019-07-09 14:04:51 +02:00
parent 2562fdbdda
commit fa21601d07
2 changed files with 36 additions and 2 deletions

View File

@@ -11,7 +11,7 @@ import (
func main() {
// Call the "real" main in a nested manner so the defers will properly
// be executed in the case of a graceful shutdown.
if err := lnd.Main(); err != nil {
if err := lnd.Main(lnd.ListenerCfg{}); err != nil {
if e, ok := err.(*flags.Error); ok && e.Type == flags.ErrHelp {
} else {
fmt.Fprintln(os.Stderr, err)