lnwire: update NodeAnnouncement to handle multiple addresses

This commit modifies address handling in the NodeAnnouncement struct,
switching from net.TCPAddr to []net.Addr. This enables more flexible
address handling with multiple types and multiple addresses for each
node. This commit addresses the first part of issue #131 .
This commit is contained in:
bryanvu authored and Olaoluwa Osuntokun committed 2017-03-29 12:03:43 -07:00
1 parent 65c15c4cb0
commit 9ffac9eae1
16 files changed
+594 -397

No files matched your search

+2 -1
View File
@@ -159,11 +159,12 @@ func newServer(listenAddrs []string, notifier chainntnfs.ChainNotifier,
if !ok {
return nil, fmt.Errorf("default listener must be TCP")
}
selfAddrs := []net.Addr{selfAddr}
chanGraph := chanDB.ChannelGraph()
self := &channeldb.LightningNode{
LastUpdate: time.Now(),
Address: selfAddr,
Addresses: selfAddrs,
PubKey: privKey.PubKey(),
// TODO(roasbeef): make alias configurable
Alias: hex.EncodeToString(serializedPubKey[:10]),