mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 05:12:34 +02:00
server: user NodeAnnouncement addresses and ports for reconnect
Use addresses and ports from NodeAnnouncement messages for reconnection attempts. For those nodes that don't explicitly report IP addresses, use the IP address from previous connections connection request along with the default peer port number.
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
085b7333cb
commit
c9c2848427
@@ -2080,7 +2080,6 @@ func testNodeAnnouncement(net *networkHarness, t *harnessTest) {
|
||||
ipAddresses := map[string]bool{
|
||||
"192.168.1.1:8333": true,
|
||||
"[2001:db8:85a3:8d3:1319:8a2e:370:7348]:8337": true,
|
||||
"127.0.0.1:8335": true,
|
||||
}
|
||||
|
||||
var lndArgs []string
|
||||
@@ -2118,8 +2117,11 @@ func testNodeAnnouncement(net *networkHarness, t *harnessTest) {
|
||||
if ipAddresses[parts[3]] {
|
||||
delete(ipAddresses, parts[3])
|
||||
} else {
|
||||
t.Fatalf("unexpected IP address: %v",
|
||||
parts[3])
|
||||
if !strings.HasPrefix(parts[3],
|
||||
"127.0.0.1:") {
|
||||
t.Fatalf("unexpected IP: %v",
|
||||
parts[3])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user