mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-26 13:42:49 +02:00
itest: add disconnect test
Add a connect/disconnect test when the peers both started up with the rbf coop close feature.
This commit is contained in:
@@ -699,6 +699,10 @@ var allTestCases = []*lntest.TestCase{
|
|||||||
Name: "rbf coop close",
|
Name: "rbf coop close",
|
||||||
TestFunc: testCoopCloseRbf,
|
TestFunc: testCoopCloseRbf,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "rbf coop close disconnect",
|
||||||
|
TestFunc: testRBFCoopCloseDisconnect,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Name: "bump fee low budget",
|
Name: "bump fee low budget",
|
||||||
TestFunc: testBumpFeeLowBudget,
|
TestFunc: testBumpFeeLowBudget,
|
||||||
|
@@ -131,3 +131,25 @@ func testCoopCloseRbf(ht *lntest.HarnessTest) {
|
|||||||
aliceClosingTxid := ht.WaitForChannelCloseEvent(aliceCloseStream)
|
aliceClosingTxid := ht.WaitForChannelCloseEvent(aliceCloseStream)
|
||||||
ht.AssertTxInBlock(block, aliceClosingTxid)
|
ht.AssertTxInBlock(block, aliceClosingTxid)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// testRBFCoopCloseDisconnect tests that when a node disconnects that the node
|
||||||
|
// is properly disconnected.
|
||||||
|
func testRBFCoopCloseDisconnect(ht *lntest.HarnessTest) {
|
||||||
|
rbfCoopFlags := []string{"--protocol.rbf-coop-close"}
|
||||||
|
|
||||||
|
// To kick things off, we'll create two new nodes, then fund them with
|
||||||
|
// enough coins to make a 50/50 channel.
|
||||||
|
cfgs := [][]string{rbfCoopFlags, rbfCoopFlags}
|
||||||
|
params := lntest.OpenChannelParams{
|
||||||
|
Amt: btcutil.Amount(1000000),
|
||||||
|
PushAmt: btcutil.Amount(1000000 / 2),
|
||||||
|
}
|
||||||
|
_, nodes := ht.CreateSimpleNetwork(cfgs, params)
|
||||||
|
alice, bob := nodes[0], nodes[1]
|
||||||
|
|
||||||
|
// Make sure the nodes are connected.
|
||||||
|
ht.AssertConnected(alice, bob)
|
||||||
|
|
||||||
|
// Disconnect Bob from Alice.
|
||||||
|
ht.DisconnectNodes(alice, bob)
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user