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:
Wilmer Paulino committed 2018-06-04 20:41:49 -07:00
1 parent 08f80b6cf3
commit 2e0484be19
4 files changed
+35 -40

No files matched your search

+1 -3
View File
@@ -54,8 +54,6 @@ type LinkNode struct {
// Addresses is a list of IP address in which either we were able to
// reach the node over in the past, OR we received an incoming
// authenticated connection for the stored identity public key.
//
// TODO(roasbeef): also need to support hidden service addrs
Addresses []net.Addr
db *DB
@@ -85,7 +83,7 @@ func (l *LinkNode) UpdateLastSeen(lastSeen time.Time) error {
// AddAddress appends the specified TCP address to the list of known addresses
// this node is/was known to be reachable at.
func (l *LinkNode) AddAddress(addr *net.TCPAddr) error {
func (l *LinkNode) AddAddress(addr net.Addr) error {
for _, a := range l.Addresses {
if a.String() == addr.String() {
return nil