mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-27 19:16:20 +02:00
itest: fix testGraphTopologyNtfns
and mark a bug in disconnectpeer
This commit is contained in:
@@ -335,10 +335,20 @@ func testGraphTopologyNtfns(ht *lntest.HarnessTest, pinned bool) {
|
|||||||
|
|
||||||
// For the final portion of the test, we'll ensure that once a new node
|
// For the final portion of the test, we'll ensure that once a new node
|
||||||
// appears in the network, the proper notification is dispatched. Note
|
// appears in the network, the proper notification is dispatched. Note
|
||||||
// that a node that does not have any channels open is ignored, so first
|
// that a node that does not have any channels open is ignored, so
|
||||||
// we disconnect Alice and Bob, open a channel between Bob and Carol,
|
// first we disconnect Alice and Bob, open a channel between Bob and
|
||||||
// and finally connect Alice to Bob again.
|
// Carol, and finally connect Alice to Bob again.
|
||||||
ht.DisconnectNodes(alice, bob)
|
ht.DisconnectNodes(bob, alice)
|
||||||
|
|
||||||
|
// Since Alice and Bob has a permanent connection, the above
|
||||||
|
// disconnection won't be enough as Alice will try to reconnect to Bob
|
||||||
|
// again. Atm, it seems nothing is stopping the reconnection. So we
|
||||||
|
// need to shutdown Alice here.
|
||||||
|
//
|
||||||
|
// TODO(yy): clearly define what `disconnectpeer` rpc is responsible
|
||||||
|
// for and its effect. If we disconnect a peer, we shouldn't allow the
|
||||||
|
// peer to connect to us again.
|
||||||
|
restartAlice := ht.SuspendNode(alice)
|
||||||
|
|
||||||
carol := ht.NewNode("Carol", nil)
|
carol := ht.NewNode("Carol", nil)
|
||||||
ht.ConnectNodes(bob, carol)
|
ht.ConnectNodes(bob, carol)
|
||||||
@@ -346,6 +356,9 @@ func testGraphTopologyNtfns(ht *lntest.HarnessTest, pinned bool) {
|
|||||||
bob, carol, lntest.OpenChannelParams{Amt: chanAmt},
|
bob, carol, lntest.OpenChannelParams{Amt: chanAmt},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Restart Alice so she can receive the channel updates from Bob.
|
||||||
|
require.NoError(ht, restartAlice(), "failed to restart Alice")
|
||||||
|
|
||||||
// Reconnect Alice and Bob. This should result in the nodes syncing up
|
// Reconnect Alice and Bob. This should result in the nodes syncing up
|
||||||
// their respective graph state, with the new addition being the
|
// their respective graph state, with the new addition being the
|
||||||
// existence of Carol in the graph, and also the channel between Bob
|
// existence of Carol in the graph, and also the channel between Bob
|
||||||
|
Reference in New Issue
Block a user