Merge changes ontop of master
This commit is contained in:
parent
80b531db62
commit
9a3dfaf332
25
lnd.go
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(
|
||||
|
Loading…
Reference in New Issue
Block a user