lnd: fallback to localhost if failing getting hostname
Needed on some versions of Android.
This commit is contained in:
parent
a6e77811b1
commit
601773958d
5
lnd.go
5
lnd.go
@ -645,8 +645,11 @@ func genCertPair(certFile, keyFile string) error {
|
|||||||
// Collect the host's names into a slice.
|
// Collect the host's names into a slice.
|
||||||
host, err := os.Hostname()
|
host, err := os.Hostname()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
rpcsLog.Errorf("Failed getting hostname, falling back to "+
|
||||||
|
"localhost: %v", err)
|
||||||
|
host = "localhost"
|
||||||
}
|
}
|
||||||
|
|
||||||
dnsNames := []string{host}
|
dnsNames := []string{host}
|
||||||
if host != "localhost" {
|
if host != "localhost" {
|
||||||
dnsNames = append(dnsNames, "localhost")
|
dnsNames = append(dnsNames, "localhost")
|
||||||
|
Loading…
Reference in New Issue
Block a user