server+lntest: use all addrs during reconnect
In this commit, all advertised addresses of a peer are used during reconnection. This fixes a bug previously demonstrated in an itest.
This commit is contained in:
2 files changed
+113
-33
No files matched your search
@@ -60,11 +60,8 @@ func testNetworkConnectionTimeout(net *lntest.NetworkHarness, t *harnessTest) {
|
||||
assertTimeoutError(ctxt, t, dave, req)
|
||||
}
|
||||
|
||||
// testReconnectAfterIPChange verifies that if an inbound node changes its
|
||||
// IP address to an IP address not listed first in its advertised address list
|
||||
// then its peer will not reconnect to it. This test asserts that this bug
|
||||
// exists and will be changed to assert that peers are able to reconnect in the
|
||||
// commit that fixes the bug.
|
||||
// testReconnectAfterIPChange verifies that if a persistent inbound node changes
|
||||
// its listening address then it's peer will still be able to reconnect to it.
|
||||
func testReconnectAfterIPChange(net *lntest.NetworkHarness, t *harnessTest) {
|
||||
// In this test, the following network will be set up. A single
|
||||
// dash line represents a peer connection and a double dash line
|
||||
@@ -197,10 +194,9 @@ func testReconnectAfterIPChange(net *lntest.NetworkHarness, t *harnessTest) {
|
||||
err := net.RestartNode(dave, nil)
|
||||
require.NoError(t.t, err)
|
||||
|
||||
// assert that Dave and Charlie do not reconnect after Dave's
|
||||
// changes to his second advertised address. This will be fixed in
|
||||
// a following commit.
|
||||
assertNotConnected(t, dave, charlie)
|
||||
// assert that Dave and Charlie reconnect successfully after Dave
|
||||
// changes to his second advertised address.
|
||||
assertConnected(t, dave, charlie)
|
||||
}
|
||||
|
||||
// assertTimeoutError asserts that a connection timeout error is raised. A
|
||||
|
||||
Reference in new issue
Block a user