lnd.xprv/cmd/lnd/main.go
Johan T. Halseth fa21601d07
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.
2019-09-05 09:22:54 +02:00

22 lines
435 B
Go

package main
import (
"fmt"
"os"
flags "github.com/jessevdk/go-flags"
"github.com/lightningnetwork/lnd"
)
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(lnd.ListenerCfg{}); err != nil {
if e, ok := err.(*flags.Error); ok && e.Type == flags.ErrHelp {
} else {
fmt.Fprintln(os.Stderr, err)
}
os.Exit(1)
}
}