Merge pull request #1159 from wpaulino/onion-service-support

multi: add onion services support
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2018-06-04 21:46:51 -07:00
commit d98d4523e1
22 files changed
+1694 -623

No files matched your search

+2 -15
View File
@@ -9,8 +9,6 @@ import (
"fmt"
"io"
"math"
"net"
"strconv"
"strings"
"time"
@@ -635,25 +633,14 @@ func (r *rpcServer) ConnectPeer(ctx context.Context,
return nil, fmt.Errorf("cannot make connection to self")
}
// If the address doesn't already have a port, we'll assume the current
// default port.
var addr string
_, _, err = net.SplitHostPort(in.Addr.Host)
if err != nil {
addr = net.JoinHostPort(in.Addr.Host, strconv.Itoa(defaultPeerPort))
} else {
addr = in.Addr.Host
}
// We use ResolveTCPAddr here in case we wish to resolve hosts over Tor.
host, err := cfg.net.ResolveTCPAddr("tcp", addr)
addr, err := parseAddr(in.Addr.Host)
if err != nil {
return nil, err
}
peerAddr := &lnwire.NetAddress{
IdentityKey: pubKey,
Address: host,
Address: addr,
ChainNet: activeNetParams.Net,
}