Merge changes ontop of master

This commit is contained in:
shtirlic 2017-11-16 19:15:09 +02:00 committed by Wilmer Paulino
parent 80b531db62
commit 9a3dfaf332
No known key found for this signature in database
GPG Key ID: 6DF57B9F9514972F

25
lnd.go

@ -26,6 +26,8 @@ import (
"sync"
"time"
"github.com/NebulousLabs/go-upnp"
"gopkg.in/macaroon-bakery.v2/bakery"
"golang.org/x/net/context"
@ -310,6 +312,29 @@ func lndMain() error {
"is proxying over Tor as well", cfg.Tor.StreamIsolation)
}
// Connect to router
d, err := upnp.Discover()
if err != nil {
fmt.Printf("Unable to discover router %v\n", err)
return err
}
// Get external IP
ip, err := d.ExternalIP()
if err != nil {
fmt.Printf("Unable to get external ip %v\n", err)
return err
}
ltndLog.Infof("Your external IP is: %s", ip)
// Forward peer port
err = d.Forward(uint16(cfg.PeerPort), "lnd pear port")
if err != nil {
fmt.Printf("Unable to forward pear port ip %v\n", err)
return err
}
// Set up the core server which will listen for incoming peer
// connections.
server, err := newServer(