From 0d0078baac6a7e8326dd53300a821d7e9b5c3654 Mon Sep 17 00:00:00 2001 From: John Griffith Date: Sat, 20 Jan 2018 17:59:43 +0000 Subject: [PATCH] Continue with server startup, even if UPNP has failed --- server.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/server.go b/server.go index 817d591b..1ac44279 100644 --- a/server.go +++ b/server.go @@ -310,28 +310,24 @@ func newServer(listenAddrs []string, chanDB *channeldb.DB, cc *chainControl, // Connect to router d, err := upnp.DiscoverCtx(context.Background()) if err != nil { - fmt.Printf("Upnp: Unable to discover router %v\n", err) - return nil, err + srvrLog.Errorf("Upnp: Unable to discover router %v\n", err) } // Get external IP ip, err := d.ExternalIP() if err != nil { - fmt.Printf("Upnp: Unable to get external ip %v\n", err) - return nil, err + srvrLog.Errorf("Upnp: Unable to get external ip %v\n", err) } - ltndLog.Infof("Your external IP is: %s", ip) - // Forward peer port err = d.Forward(uint16(cfg.PeerPort), "lnd peer port") if err != nil { - fmt.Printf("Upnp: Unable to forward pear port ip %v\n", err) - return nil, err + srvrLog.Errorf("Upnp: Unable to forward pear port ip %v\n", err) + } else { + srvrLog.Infof("Your external IP is: %s", ip) + externalIPs = append(externalIPs, ip) } - externalIPs = append(externalIPs, ip) - } // If external IP addresses have been specified, add those to the list