mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-02 03:54:26 +02:00
multi: ensure addresses are no longer assumed to be TCP addresses only
In this commit, we go through the codebase looking for TCP address assumptions and modifying them to include the recently introduced onion addresses. This enables us to fully support onion addresses within the daemon.
This commit is contained in:
@@ -165,12 +165,12 @@ func (c *ChannelGraphBootstrapper) SampleNodeAddrs(numAddrs uint32,
|
||||
// If we haven't yet reached our limit, then
|
||||
// we'll copy over the details of this node
|
||||
// into the set of addresses to be returned.
|
||||
tcpAddr, ok := nodeAddr.(*net.TCPAddr)
|
||||
if !ok {
|
||||
// If this isn't a valid TCP address,
|
||||
// then we'll ignore it as currently
|
||||
// we'll only attempt to connect out to
|
||||
// TCP peers.
|
||||
switch nodeAddr.(type) {
|
||||
case *net.TCPAddr, *tor.OnionAddr:
|
||||
default:
|
||||
// If this isn't a valid address
|
||||
// supported by the protocol, then we'll
|
||||
// skip this node.
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ func (c *ChannelGraphBootstrapper) SampleNodeAddrs(numAddrs uint32,
|
||||
// error.
|
||||
a = append(a, &lnwire.NetAddress{
|
||||
IdentityKey: node.PubKey(),
|
||||
Address: tcpAddr,
|
||||
Address: nodeAddr,
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user