@@ -2496,7 +2496,7 @@ func testChannelForceClosure(net *lntest.NetworkHarness, t *harnessTest) {
2496
2496
// At this point, the sweeping transaction should now be broadcast. So
2497
2497
// we fetch the node's mempool to ensure it has been properly
2498
2498
// broadcast.
2499
- sweepingTXID , err := waitForTxInMempool (net .Miner .Node , 3 * time . Second )
2499
+ sweepingTXID , err := waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
2500
2500
if err != nil {
2501
2501
t .Fatalf ("failed to get sweep tx from mempool: %v" , err )
2502
2502
}
@@ -2667,7 +2667,7 @@ func testChannelForceClosure(net *lntest.NetworkHarness, t *harnessTest) {
2667
2667
// closing, we expect Alice to broadcast an htlc timeout txn for each
2668
2668
// one. Wait for them all to show up in the mempool.
2669
2669
htlcTxIDs , err := waitForNTxsInMempool (net .Miner .Node , numInvoices ,
2670
- 10 * time . Second )
2670
+ minerMempoolTimeout )
2671
2671
if err != nil {
2672
2672
t .Fatalf ("unable to find htlc timeout txns in mempool: %v" , err )
2673
2673
}
@@ -2780,7 +2780,7 @@ func testChannelForceClosure(net *lntest.NetworkHarness, t *harnessTest) {
2780
2780
}
2781
2781
2782
2782
// Wait for the single sweep txn to appear in the mempool.
2783
- htlcSweepTxID , err := waitForTxInMempool (net .Miner .Node , 15 * time . Second )
2783
+ htlcSweepTxID , err := waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
2784
2784
if err != nil {
2785
2785
t .Fatalf ("failed to get sweep tx from mempool: %v" , err )
2786
2786
}
@@ -5733,7 +5733,7 @@ func testFailingChannel(net *lntest.NetworkHarness, t *harnessTest) {
5733
5733
}
5734
5734
5735
5735
// Carol will use the correct preimage to resolve the HTLC on-chain.
5736
- _ , err = waitForTxInMempool (net .Miner .Node , 5 * time . Second )
5736
+ _ , err = waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
5737
5737
if err != nil {
5738
5738
t .Fatalf ("unable to find Bob's breach tx in mempool: %v" , err )
5739
5739
}
@@ -5746,7 +5746,7 @@ func testFailingChannel(net *lntest.NetworkHarness, t *harnessTest) {
5746
5746
}
5747
5747
5748
5748
// Wait for the sweeping tx to be broadcast.
5749
- _ , err = waitForTxInMempool (net .Miner .Node , 5 * time . Second )
5749
+ _ , err = waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
5750
5750
if err != nil {
5751
5751
t .Fatalf ("unable to find Bob's breach tx in mempool: %v" , err )
5752
5752
}
@@ -6218,7 +6218,7 @@ func testRevokedCloseRetribution(net *lntest.NetworkHarness, t *harnessTest) {
6218
6218
6219
6219
// Wait for Bob's breach transaction to show up in the mempool to ensure
6220
6220
// that Carol's node has started waiting for confirmations.
6221
- _ , err = waitForTxInMempool (net .Miner .Node , 5 * time . Second )
6221
+ _ , err = waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
6222
6222
if err != nil {
6223
6223
t .Fatalf ("unable to find Bob's breach tx in mempool: %v" , err )
6224
6224
}
@@ -6246,7 +6246,7 @@ func testRevokedCloseRetribution(net *lntest.NetworkHarness, t *harnessTest) {
6246
6246
// Query the mempool for Carol's justice transaction, this should be
6247
6247
// broadcast as Bob's contract breaching transaction gets confirmed
6248
6248
// above.
6249
- justiceTXID , err := waitForTxInMempool (net .Miner .Node , 5 * time . Second )
6249
+ justiceTXID , err := waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
6250
6250
if err != nil {
6251
6251
t .Fatalf ("unable to find Carol's justice tx in mempool: %v" , err )
6252
6252
}
@@ -6457,7 +6457,7 @@ func testRevokedCloseRetributionZeroValueRemoteOutput(net *lntest.NetworkHarness
6457
6457
6458
6458
// Query the mempool for the breaching closing transaction, this should
6459
6459
// be broadcast by Carol when she force closes the channel above.
6460
- txid , err := waitForTxInMempool (net .Miner .Node , 20 * time . Second )
6460
+ txid , err := waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
6461
6461
if err != nil {
6462
6462
t .Fatalf ("unable to find Carol's force close tx in mempool: %v" ,
6463
6463
err )
@@ -6488,7 +6488,7 @@ func testRevokedCloseRetributionZeroValueRemoteOutput(net *lntest.NetworkHarness
6488
6488
// Query the mempool for Dave's justice transaction, this should be
6489
6489
// broadcast as Carol's contract breaching transaction gets confirmed
6490
6490
// above.
6491
- justiceTXID , err := waitForTxInMempool (net .Miner .Node , 15 * time . Second )
6491
+ justiceTXID , err := waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
6492
6492
if err != nil {
6493
6493
t .Fatalf ("unable to find Dave's justice tx in mempool: %v" ,
6494
6494
err )
@@ -6774,7 +6774,7 @@ func testRevokedCloseRetributionRemoteHodl(net *lntest.NetworkHarness,
6774
6774
6775
6775
// Query the mempool for the breaching closing transaction, this should
6776
6776
// be broadcast by Carol when she force closes the channel above.
6777
- txid , err := waitForTxInMempool (net .Miner .Node , 20 * time . Second )
6777
+ txid , err := waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
6778
6778
if err != nil {
6779
6779
t .Fatalf ("unable to find Carol's force close tx in mempool: %v" ,
6780
6780
err )
@@ -7190,7 +7190,7 @@ func testDataLossProtection(net *lntest.NetworkHarness, t *harnessTest) {
7190
7190
7191
7191
// Upon reconnection, the nodes should detect that Dave is out of sync.
7192
7192
// Carol should force close the channel using her latest commitment.
7193
- forceClose , err := waitForTxInMempool (net .Miner .Node , 15 * time . Second )
7193
+ forceClose , err := waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
7194
7194
if err != nil {
7195
7195
t .Fatalf ("unable to find Carol's force close tx in mempool: %v" ,
7196
7196
err )
@@ -7216,7 +7216,7 @@ func testDataLossProtection(net *lntest.NetworkHarness, t *harnessTest) {
7216
7216
assertTxInBlock (t , block , forceClose )
7217
7217
7218
7218
// Dave should sweep his funds immediately, as they are not timelocked.
7219
- daveSweep , err := waitForTxInMempool (net .Miner .Node , 15 * time . Second )
7219
+ daveSweep , err := waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
7220
7220
if err != nil {
7221
7221
t .Fatalf ("unable to find Dave's sweep tx in mempool: %v" , err )
7222
7222
}
@@ -7251,7 +7251,7 @@ func testDataLossProtection(net *lntest.NetworkHarness, t *harnessTest) {
7251
7251
7252
7252
// After the Carol's output matures, she should also reclaim her funds.
7253
7253
mineBlocks (t , net , defaultCSV - 1 )
7254
- carolSweep , err := waitForTxInMempool (net .Miner .Node , 15 * time . Second )
7254
+ carolSweep , err := waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
7255
7255
if err != nil {
7256
7256
t .Fatalf ("unable to find Carol's sweep tx in mempool: %v" , err )
7257
7257
}
@@ -7308,7 +7308,7 @@ func testDataLossProtection(net *lntest.NetworkHarness, t *harnessTest) {
7308
7308
// Mine enough blocks for Carol to sweep her funds.
7309
7309
mineBlocks (t , net , defaultCSV )
7310
7310
7311
- carolSweep , err = waitForTxInMempool (net .Miner .Node , 15 * time . Second )
7311
+ carolSweep , err = waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
7312
7312
if err != nil {
7313
7313
t .Fatalf ("unable to find Carol's sweep tx in mempool: %v" , err )
7314
7314
}
@@ -7340,7 +7340,7 @@ func testDataLossProtection(net *lntest.NetworkHarness, t *harnessTest) {
7340
7340
}
7341
7341
7342
7342
// Dave should sweep his funds.
7343
- _ , err = waitForTxInMempool (net .Miner .Node , 15 * time . Second )
7343
+ _ , err = waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
7344
7344
if err != nil {
7345
7345
t .Fatalf ("unable to find Dave's sweep tx in mempool: %v" , err )
7346
7346
}
@@ -8790,7 +8790,7 @@ func testMultiHopHtlcLocalTimeout(net *lntest.NetworkHarness, t *harnessTest) {
8790
8790
t .Fatalf ("unable to create sha hash: %v" , err )
8791
8791
}
8792
8792
assertSpendingTxInMempool (
8793
- t , net .Miner .Node , time . Second * 10 , wire.OutPoint {
8793
+ t , net .Miner .Node , minerMempoolTimeout , wire.OutPoint {
8794
8794
Hash : * bobFundingTxid ,
8795
8795
Index : bobChanPoint .OutputIndex ,
8796
8796
},
@@ -8821,7 +8821,7 @@ func testMultiHopHtlcLocalTimeout(net *lntest.NetworkHarness, t *harnessTest) {
8821
8821
t .Fatalf ("unable to generate blocks: %v" , err )
8822
8822
}
8823
8823
8824
- _ , err = waitForTxInMempool (net .Miner .Node , 10 * time . Second )
8824
+ _ , err = waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
8825
8825
if err != nil {
8826
8826
t .Fatalf ("unable to find bob's funding output sweep tx: %v" , err )
8827
8827
}
@@ -8834,7 +8834,7 @@ func testMultiHopHtlcLocalTimeout(net *lntest.NetworkHarness, t *harnessTest) {
8834
8834
8835
8835
// The second layer HTLC timeout transaction should now have been
8836
8836
// broadcast on-chain.
8837
- secondLayerHash , err := waitForTxInMempool (net .Miner .Node , time . Second * 10 )
8837
+ secondLayerHash , err := waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
8838
8838
if err != nil {
8839
8839
t .Fatalf ("unable to find bob's second layer transaction" )
8840
8840
}
@@ -8895,7 +8895,7 @@ func testMultiHopHtlcLocalTimeout(net *lntest.NetworkHarness, t *harnessTest) {
8895
8895
if _ , err := net .Miner .Node .Generate (4 ); err != nil {
8896
8896
t .Fatalf ("unable to generate blocks: %v" , err )
8897
8897
}
8898
- _ , err = waitForTxInMempool (net .Miner .Node , time . Second * 10 )
8898
+ _ , err = waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
8899
8899
if err != nil {
8900
8900
t .Fatalf ("unable to find bob's sweeping transaction: %v" , err )
8901
8901
}
@@ -9000,7 +9000,7 @@ func testMultiHopReceiverChainClaim(net *lntest.NetworkHarness, t *harnessTest)
9000
9000
9001
9001
// At this point, Carol should broadcast her active commitment
9002
9002
// transaction in order to go to the chain and sweep her HTLC.
9003
- txids , err := waitForNTxsInMempool (net .Miner .Node , 1 , time . Second * 20 )
9003
+ txids , err := waitForNTxsInMempool (net .Miner .Node , 1 , minerMempoolTimeout )
9004
9004
if err != nil {
9005
9005
t .Fatalf ("expected transaction not found in mempool: %v" , err )
9006
9006
}
@@ -9043,7 +9043,7 @@ func testMultiHopReceiverChainClaim(net *lntest.NetworkHarness, t *harnessTest)
9043
9043
// second level transaction in the mempool, he will extract the
9044
9044
// preimage and settle the HTLC back off-chain.
9045
9045
secondLevelHashes , err := waitForNTxsInMempool (net .Miner .Node , 2 ,
9046
- time . Second * 15 )
9046
+ minerMempoolTimeout )
9047
9047
if err != nil {
9048
9048
t .Fatalf ("transactions not found in mempool: %v" , err )
9049
9049
}
@@ -9124,7 +9124,7 @@ func testMultiHopReceiverChainClaim(net *lntest.NetworkHarness, t *harnessTest)
9124
9124
}
9125
9125
9126
9126
// We should have a new transaction in the mempool.
9127
- _ , err = waitForTxInMempool (net .Miner .Node , time . Second * 10 )
9127
+ _ , err = waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
9128
9128
if err != nil {
9129
9129
t .Fatalf ("unable to find bob's sweeping transaction: %v" , err )
9130
9130
}
@@ -9262,7 +9262,7 @@ func testMultiHopLocalForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
9262
9262
t .Fatalf ("unable to generate blocks: %v" , err )
9263
9263
}
9264
9264
9265
- _ , err = waitForTxInMempool (net .Miner .Node , 10 * time . Second )
9265
+ _ , err = waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
9266
9266
if err != nil {
9267
9267
t .Fatalf ("unable to find bob's funding output sweep tx: %v" , err )
9268
9268
}
@@ -9311,7 +9311,7 @@ func testMultiHopLocalForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
9311
9311
9312
9312
// We should also now find a transaction in the mempool, as Bob should
9313
9313
// have broadcast his second layer timeout transaction.
9314
- timeoutTx , err := waitForTxInMempool (net .Miner .Node , 10 * time . Second )
9314
+ timeoutTx , err := waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
9315
9315
if err != nil {
9316
9316
t .Fatalf ("unable to find bob's htlc timeout tx: %v" , err )
9317
9317
}
@@ -9378,7 +9378,7 @@ func testMultiHopLocalForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
9378
9378
t .Fatalf ("unable to mine blocks: %v" , err )
9379
9379
}
9380
9380
9381
- sweepTx , err := waitForTxInMempool (net .Miner .Node , 10 * time . Second )
9381
+ sweepTx , err := waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
9382
9382
if err != nil {
9383
9383
t .Fatalf ("unable to find bob's htlc sweep tx: %v" , err )
9384
9384
}
@@ -9506,7 +9506,7 @@ func testMultiHopRemoteForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
9506
9506
}
9507
9507
9508
9508
// Bob can sweep his output immediately.
9509
- _ , err = waitForTxInMempool (net .Miner .Node , 20 * time . Second )
9509
+ _ , err = waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
9510
9510
if err != nil {
9511
9511
t .Fatalf ("unable to find bob's funding output sweep tx: %v" ,
9512
9512
err )
@@ -9558,7 +9558,7 @@ func testMultiHopRemoteForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
9558
9558
9559
9559
// Bob's sweeping transaction should now be found in the mempool at
9560
9560
// this point.
9561
- sweepTx , err := waitForTxInMempool (net .Miner .Node , time . Second * 10 )
9561
+ sweepTx , err := waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
9562
9562
if err != nil {
9563
9563
// If Bob's transaction isn't yet in the mempool, then due to
9564
9564
// internal message passing and the low period between blocks
@@ -9571,7 +9571,7 @@ func testMultiHopRemoteForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
9571
9571
if _ , err := net .Miner .Node .Generate (1 ); err != nil {
9572
9572
t .Fatalf ("unable to generate block: %v" , err )
9573
9573
}
9574
- sweepTx , err = waitForTxInMempool (net .Miner .Node , time . Second * 10 )
9574
+ sweepTx , err = waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
9575
9575
if err != nil {
9576
9576
t .Fatalf ("unable to find bob's sweeping transaction: " +
9577
9577
"%v" , err )
@@ -9699,7 +9699,7 @@ func testMultiHopHtlcLocalChainClaim(net *lntest.NetworkHarness, t *harnessTest)
9699
9699
}
9700
9700
9701
9701
// Carol's commitment transaction should now be in the mempool.
9702
- txids , err := waitForNTxsInMempool (net .Miner .Node , 1 , time . Second * 15 )
9702
+ txids , err := waitForNTxsInMempool (net .Miner .Node , 1 , minerMempoolTimeout )
9703
9703
if err != nil {
9704
9704
t .Fatalf ("transactions not found in mempool: %v" , err )
9705
9705
}
@@ -9741,7 +9741,7 @@ func testMultiHopHtlcLocalChainClaim(net *lntest.NetworkHarness, t *harnessTest)
9741
9741
// immediately, as the output is not timelocked since Carol was the one
9742
9742
// force closing.
9743
9743
commitSpends , err := waitForNTxsInMempool (net .Miner .Node , 2 ,
9744
- time . Second * 20 )
9744
+ minerMempoolTimeout )
9745
9745
if err != nil {
9746
9746
t .Fatalf ("transactions not found in mempool: %v" , err )
9747
9747
}
@@ -9776,7 +9776,7 @@ func testMultiHopHtlcLocalChainClaim(net *lntest.NetworkHarness, t *harnessTest)
9776
9776
// will extract the preimage and broadcast a second level tx to claim
9777
9777
// the HTLC in his (already closed) channel with Alice.
9778
9778
bobSecondLvlTx , err := waitForTxInMempool (net .Miner .Node ,
9779
- time . Second * 20 )
9779
+ minerMempoolTimeout )
9780
9780
if err != nil {
9781
9781
t .Fatalf ("transactions not found in mempool: %v" , err )
9782
9782
}
@@ -9855,7 +9855,7 @@ func testMultiHopHtlcLocalChainClaim(net *lntest.NetworkHarness, t *harnessTest)
9855
9855
}
9856
9856
bobSecondLevelCSV -= carolSecondLevelCSV
9857
9857
9858
- carolSweep , err := waitForTxInMempool (net .Miner .Node , time . Second * 10 )
9858
+ carolSweep , err := waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
9859
9859
if err != nil {
9860
9860
t .Fatalf ("unable to find Carol's sweeping transaction: %v" , err )
9861
9861
}
@@ -9865,7 +9865,7 @@ func testMultiHopHtlcLocalChainClaim(net *lntest.NetworkHarness, t *harnessTest)
9865
9865
block = mineBlocks (t , net , bobSecondLevelCSV )[0 ]
9866
9866
assertTxInBlock (t , block , carolSweep )
9867
9867
9868
- bobSweep , err := waitForTxInMempool (net .Miner .Node , time . Second * 10 )
9868
+ bobSweep , err := waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
9869
9869
if err != nil {
9870
9870
t .Fatalf ("unable to find bob's sweeping transaction" )
9871
9871
}
@@ -10046,7 +10046,7 @@ func testMultiHopHtlcRemoteChainClaim(net *lntest.NetworkHarness, t *harnessTest
10046
10046
}
10047
10047
10048
10048
// Carol's commitment transaction should now be in the mempool.
10049
- txids , err := waitForNTxsInMempool (net .Miner .Node , 1 , time . Second * 15 )
10049
+ txids , err := waitForNTxsInMempool (net .Miner .Node , 1 , minerMempoolTimeout )
10050
10050
if err != nil {
10051
10051
t .Fatalf ("transactions not found in mempool: %v" , err )
10052
10052
}
@@ -10088,7 +10088,7 @@ func testMultiHopHtlcRemoteChainClaim(net *lntest.NetworkHarness, t *harnessTest
10088
10088
// immediately, as the output is not timelocked since Carol was the one
10089
10089
// force closing.
10090
10090
commitSpends , err := waitForNTxsInMempool (net .Miner .Node , 2 ,
10091
- time . Second * 20 )
10091
+ minerMempoolTimeout )
10092
10092
if err != nil {
10093
10093
t .Fatalf ("transactions not found in mempool: %v" , err )
10094
10094
}
@@ -10123,7 +10123,7 @@ func testMultiHopHtlcRemoteChainClaim(net *lntest.NetworkHarness, t *harnessTest
10123
10123
// will extract the preimage and broadcast a sweep tx to directly claim
10124
10124
// the HTLC in his (already closed) channel with Alice.
10125
10125
bobHtlcSweep , err := waitForTxInMempool (net .Miner .Node ,
10126
- time . Second * 20 )
10126
+ minerMempoolTimeout )
10127
10127
if err != nil {
10128
10128
t .Fatalf ("transactions not found in mempool: %v" , err )
10129
10129
}
@@ -10178,7 +10178,7 @@ func testMultiHopHtlcRemoteChainClaim(net *lntest.NetworkHarness, t *harnessTest
10178
10178
t .Fatalf ("unable to generate block: %v" , err )
10179
10179
}
10180
10180
10181
- carolSweep , err := waitForTxInMempool (net .Miner .Node , time . Second * 10 )
10181
+ carolSweep , err := waitForTxInMempool (net .Miner .Node , minerMempoolTimeout )
10182
10182
if err != nil {
10183
10183
t .Fatalf ("unable to find Carol's sweeping transaction: %v" , err )
10184
10184
}
@@ -12169,7 +12169,7 @@ func testSendUpdateDisableChannel(net *lntest.NetworkHarness, t *harnessTest) {
12169
12169
)
12170
12170
12171
12171
// Finally, close the channels by mining the closing transactions.
12172
- _ , err = waitForNTxsInMempool (net .Miner .Node , 2 , timeout )
12172
+ _ , err = waitForNTxsInMempool (net .Miner .Node , 2 , minerMempoolTimeout )
12173
12173
if err != nil {
12174
12174
t .Fatalf ("expected transactions not found in mempool: %v" , err )
12175
12175
}
@@ -12189,7 +12189,7 @@ func testSendUpdateDisableChannel(net *lntest.NetworkHarness, t *harnessTest) {
12189
12189
},
12190
12190
)
12191
12191
12192
- _ , err = waitForNTxsInMempool (net .Miner .Node , 1 , timeout )
12192
+ _ , err = waitForNTxsInMempool (net .Miner .Node , 1 , minerMempoolTimeout )
12193
12193
if err != nil {
12194
12194
t .Fatalf ("expected transactions not found in mempool: %v" , err )
12195
12195
}
0 commit comments