@@ -1382,15 +1382,9 @@ func testCustomChannelsForceClose(ctx context.Context, net *NetworkHarness,
1382
1382
1383
1383
t .Logf ("Universe proofs located!" )
1384
1384
1385
- time .Sleep (time .Second * 1 )
1386
-
1387
- // We'll mine one more block, which triggers the 1 CSV needed for Dave
1388
- // to sweep his output.
1389
- mineBlocks (t , net , 1 , 0 )
1390
-
1391
1385
// We should also have a new sweep transaction in the mempool.
1392
1386
daveSweepTxid , err := waitForNTxsInMempool (
1393
- net .Miner .Client , 1 , time . Second * 5 ,
1387
+ net .Miner .Client , 1 , shortTimeout ,
1394
1388
)
1395
1389
require .NoError (t .t , err )
1396
1390
@@ -1412,11 +1406,11 @@ func testCustomChannelsForceClose(ctx context.Context, net *NetworkHarness,
1412
1406
1413
1407
// Next, we'll mine three additional blocks to trigger the CSV delay
1414
1408
// for Charlie.
1415
- mineBlocks (t , net , 3 , 0 )
1409
+ mineBlocks (t , net , 4 , 0 )
1416
1410
1417
1411
// We expect that Charlie's sweep transaction has been broadcast.
1418
1412
charlieSweepTxid , err := waitForNTxsInMempool (
1419
- net .Miner .Client , 1 , time . Second * 5 ,
1413
+ net .Miner .Client , 1 , shortTimeout ,
1420
1414
)
1421
1415
require .NoError (t .t , err )
1422
1416
@@ -1780,15 +1774,17 @@ func testCustomChannelsLiquidityEdgeCases(ctx context.Context,
1780
1774
connectAllNodes (t .t , net , nodes )
1781
1775
fundAllNodes (t .t , net , nodes )
1782
1776
1783
- // Create the normal channel between Dave and Erin.
1777
+ // Create the normal channel between Dave and Erin. We don't clean up
1778
+ // this channel because we expect there to be in-flight HTLCs due to
1779
+ // some of the edge cases we're testing. Waiting for those HTLCs to time
1780
+ // out would take too long.
1784
1781
t .Logf ("Opening normal channel between Dave and Erin..." )
1785
1782
channelOp := openChannelAndAssert (
1786
1783
t , net , dave , erin , lntest.OpenChannelParams {
1787
1784
Amt : 10_000_000 ,
1788
1785
SatPerVByte : 5 ,
1789
1786
},
1790
1787
)
1791
- defer closeChannelAndAssert (t , net , dave , channelOp , true )
1792
1788
1793
1789
// This is the only public channel, we need everyone to be aware of it.
1794
1790
assertChannelKnown (t .t , charlie , channelOp )
@@ -2235,7 +2231,7 @@ func testCustomChannelsStrictForwarding(ctx context.Context,
2235
2231
SatPerVByte : 5 ,
2236
2232
},
2237
2233
)
2238
- defer closeChannelAndAssert (t , net , dave , channelOp , true )
2234
+ defer closeChannelAndAssert (t , net , dave , channelOp , false )
2239
2235
2240
2236
// This is the only public channel, we need everyone to be aware of it.
2241
2237
assertChannelKnown (t .t , charlie , channelOp )
@@ -2315,11 +2311,9 @@ func testCustomChannelsStrictForwarding(ctx context.Context,
2315
2311
// Erin pays Dave with enough satoshis, but Charlie will not settle as
2316
2312
// he expects assets.
2317
2313
hops := [][]byte {dave .PubKey [:]}
2318
- payInvoiceWithSatoshiLastHop (
2319
- t .t , erin , assetInvoice , hops , withFailure (
2320
- lnrpc .Payment_FAILED , 0 ,
2321
- ),
2322
- )
2314
+ payInvoiceWithSatoshiLastHop (t .t , erin , assetInvoice , hops , withFailure (
2315
+ lnrpc .Payment_FAILED , 0 ,
2316
+ ))
2323
2317
2324
2318
// Make sure the invoice hasn't been settled and there's no HTLC on the
2325
2319
// channel between Erin and Dave.
@@ -3326,9 +3320,6 @@ func runCustomChannelsHtlcForceClose(ctx context.Context, t *harnessTest,
3326
3320
walletrpc .WitnessType_TAPROOT_HTLC_ACCEPTED_REMOTE_SUCCESS ,
3327
3321
)
3328
3322
3329
- // We'll mine an empty block to get the sweeper to tick.
3330
- mineBlocks (t , net , 1 , 0 )
3331
-
3332
3323
bobSweepTx1 , err := waitForNTxsInMempool (
3333
3324
net .Miner .Client , 1 , shortTimeout ,
3334
3325
)
@@ -3523,9 +3514,6 @@ func runCustomChannelsHtlcForceClose(ctx context.Context, t *harnessTest,
3523
3514
walletrpc .WitnessType_TAPROOT_HTLC_OFFERED_REMOTE_TIMEOUT ,
3524
3515
)
3525
3516
3526
- // We'll mine an extra block to trigger the sweeper.
3527
- mineBlocks (t , net , 1 , 0 )
3528
-
3529
3517
t .Logf ("Confirming initial HTLC timeout txns" )
3530
3518
3531
3519
// Finally, we'll mine a single block to confirm them.
0 commit comments