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
2017-02-17 01:29:23 -08:00
committed by Olaoluwa Osuntokun
parent 65c15c4cb0
commit 9ffac9eae1
16 changed files with 594 additions and 397 deletions

View File

@ -135,10 +135,12 @@ func parseTestGraph(path string) (*channeldb.ChannelGraph, func(), aliasMap, err
// We'll use this fake address for the IP address of all the nodes in
// our tests. This value isn't needed for path finding so it doesn't
// need to be unique.
var testAddrs []net.Addr
testAddr, err := net.ResolveTCPAddr("tcp", "192.0.0.1:8888")
if err != nil {
return nil, nil, nil, err
}
testAddrs = append(testAddrs, testAddr)
// Next, create a temporary graph database for usage within the test.
graph, cleanUp, err := makeTestGraph()
@ -162,7 +164,7 @@ func parseTestGraph(path string) (*channeldb.ChannelGraph, func(), aliasMap, err
dbNode := &channeldb.LightningNode{
LastUpdate: time.Now(),
Address: testAddr,
Addresses: testAddrs,
PubKey: pub,
Alias: node.Alias,
}