@@ -98,12 +98,14 @@ func testSweepCPFPAnchorOutgoingTimeout(ht *lntest.HarnessTest) {
9898 // swept so we can focus on testing HTLCs.
9999 fmt .Sprintf ("--bitcoin.defaultremotedelay=%v" , cltvDelta * 10 ),
100100 }
101+ cfgs := [][]string {cfg , cfg , cfg }
102+
101103 openChannelParams := lntest.OpenChannelParams {
102104 Amt : invoiceAmt * 10 ,
103105 }
104106
105107 // Create a three hop network: Alice -> Bob -> Carol.
106- chanPoints , nodes := createSimpleNetwork ( ht , cfg , 3 , openChannelParams )
108+ chanPoints , nodes := ht . CreateSimpleNetwork ( cfgs , openChannelParams )
107109
108110 // Unwrap the results.
109111 abChanPoint , bcChanPoint := chanPoints [0 ], chanPoints [1 ]
@@ -426,12 +428,14 @@ func testSweepCPFPAnchorIncomingTimeout(ht *lntest.HarnessTest) {
426428 // swept so we can focus on testing HTLCs.
427429 fmt .Sprintf ("--bitcoin.defaultremotedelay=%v" , cltvDelta * 10 ),
428430 }
431+ cfgs := [][]string {cfg , cfg , cfg }
432+
429433 openChannelParams := lntest.OpenChannelParams {
430434 Amt : invoiceAmt * 10 ,
431435 }
432436
433437 // Create a three hop network: Alice -> Bob -> Carol.
434- chanPoints , nodes := createSimpleNetwork ( ht , cfg , 3 , openChannelParams )
438+ chanPoints , nodes := ht . CreateSimpleNetwork ( cfgs , openChannelParams )
435439
436440 // Unwrap the results.
437441 abChanPoint , bcChanPoint := chanPoints [0 ], chanPoints [1 ]
@@ -771,12 +775,14 @@ func testSweepHTLCs(ht *lntest.HarnessTest) {
771775 // swept so we can focus on testing HTLCs.
772776 fmt .Sprintf ("--bitcoin.defaultremotedelay=%v" , cltvDelta * 10 ),
773777 }
778+ cfgs := [][]string {cfg , cfg , cfg }
779+
774780 openChannelParams := lntest.OpenChannelParams {
775781 Amt : invoiceAmt * 10 ,
776782 }
777783
778784 // Create a three hop network: Alice -> Bob -> Carol.
779- chanPoints , nodes := createSimpleNetwork ( ht , cfg , 3 , openChannelParams )
785+ chanPoints , nodes := ht . CreateSimpleNetwork ( cfgs , openChannelParams )
780786
781787 // Unwrap the results.
782788 abChanPoint , bcChanPoint := chanPoints [0 ], chanPoints [1 ]
@@ -1298,13 +1304,15 @@ func testSweepCommitOutputAndAnchor(ht *lntest.HarnessTest) {
12981304 fmt .Sprintf ("--sweeper.nodeadlineconftarget=%v" , deadline ),
12991305 fmt .Sprintf ("--bitcoin.defaultremotedelay=%v" , toLocalCSV ),
13001306 }
1307+ cfgs := [][]string {cfg , cfg }
1308+
13011309 openChannelParams := lntest.OpenChannelParams {
13021310 Amt : fundAmt ,
13031311 PushAmt : bobBalance ,
13041312 }
13051313
13061314 // Create a two hop network: Alice -> Bob.
1307- chanPoints , nodes := createSimpleNetwork ( ht , cfg , 2 , openChannelParams )
1315+ chanPoints , nodes := ht . CreateSimpleNetwork ( cfgs , openChannelParams )
13081316
13091317 // Unwrap the results.
13101318 chanPoint := chanPoints [0 ]
@@ -1780,67 +1788,6 @@ func testSweepCommitOutputAndAnchor(ht *lntest.HarnessTest) {
17801788 ht .MineBlocksAndAssertNumTxes (1 , 2 )
17811789}
17821790
1783- // createSimpleNetwork creates the specified number of nodes and makes a
1784- // topology of `node1 -> node2 -> node3...`. Each node is created using the
1785- // specified config, the neighbors are connected, and the channels are opened.
1786- // Each node will be funded with a single UTXO of 1 BTC except the last one.
1787- func createSimpleNetwork (ht * lntest.HarnessTest , nodeCfg []string ,
1788- numNodes int , p lntest.OpenChannelParams ) ([]* lnrpc.ChannelPoint ,
1789- []* node.HarnessNode ) {
1790-
1791- // Make a slice of nodes.
1792- nodes := make ([]* node.HarnessNode , numNodes )
1793-
1794- // Create new nodes.
1795- for i := range nodes {
1796- nodeName := fmt .Sprintf ("Node%q" , string (rune ('A' + i )))
1797- n := ht .NewNode (nodeName , nodeCfg )
1798- nodes [i ] = n
1799- }
1800-
1801- // Connect the nodes in a chain.
1802- for i := 1 ; i < len (nodes ); i ++ {
1803- nodeA := nodes [i - 1 ]
1804- nodeB := nodes [i ]
1805- ht .EnsureConnected (nodeA , nodeB )
1806- }
1807-
1808- // Fund all the nodes expect the last one.
1809- for i := 0 ; i < len (nodes )- 1 ; i ++ {
1810- node := nodes [i ]
1811- ht .FundCoinsUnconfirmed (btcutil .SatoshiPerBitcoin , node )
1812- }
1813-
1814- // Mine 1 block to get the above coins confirmed.
1815- ht .MineBlocksAndAssertNumTxes (1 , numNodes - 1 )
1816-
1817- // Open channels in batch to save blocks mined.
1818- reqs := make ([]* lntest.OpenChannelRequest , 0 , len (nodes )- 1 )
1819- for i := 0 ; i < len (nodes )- 1 ; i ++ {
1820- nodeA := nodes [i ]
1821- nodeB := nodes [i + 1 ]
1822-
1823- req := & lntest.OpenChannelRequest {
1824- Local : nodeA ,
1825- Remote : nodeB ,
1826- Param : p ,
1827- }
1828- reqs = append (reqs , req )
1829- }
1830- resp := ht .OpenMultiChannelsAsync (reqs )
1831-
1832- // Make sure the nodes know each other's channels if they are public.
1833- if ! p .Private {
1834- for _ , node := range nodes {
1835- for _ , chanPoint := range resp {
1836- ht .AssertTopologyChannelOpen (node , chanPoint )
1837- }
1838- }
1839- }
1840-
1841- return resp , nodes
1842- }
1843-
18441791// testBumpFee checks that when a new input is requested, it's first bumped via
18451792// CPFP, then RBF. Along the way, we check the `BumpFee` can properly update
18461793// the fee function used by supplying new params.
@@ -2185,9 +2132,10 @@ func testBumpForceCloseFee(ht *lntest.HarnessTest) {
21852132 cfg := []string {
21862133 "--protocol.anchors" ,
21872134 }
2135+ cfgs := [][]string {cfg , cfg }
21882136
21892137 // Create a two hop network: Alice -> Bob.
2190- chanPoints , nodes := createSimpleNetwork ( ht , cfg , 2 , openChannelParams )
2138+ chanPoints , nodes := ht . CreateSimpleNetwork ( cfgs , openChannelParams )
21912139
21922140 // Unwrap the results.
21932141 chanPoint := chanPoints [0 ]
0 commit comments