@@ -2182,7 +2182,6 @@ func testChannelForceClosure(net *lntest.NetworkHarness, t *harnessTest) {
2182
2182
2183
2183
// TODO(roasbeef): should check default value in config here
2184
2184
// instead, or make delay a param
2185
- defaultCSV := uint32 (4 )
2186
2185
defaultCLTV := uint32 (defaultBitcoinTimeLockDelta )
2187
2186
2188
2187
// Since we'd like to test failure scenarios with outstanding htlcs,
@@ -5594,7 +5593,6 @@ func testFailingChannel(net *lntest.NetworkHarness, t *harnessTest) {
5594
5593
const (
5595
5594
timeout = time .Duration (time .Second * 10 )
5596
5595
paymentAmt = 10000
5597
- defaultCSV = 4
5598
5596
)
5599
5597
5600
5598
chanAmt := maxFundingAmount
@@ -6986,7 +6984,6 @@ func testDataLossProtection(net *lntest.NetworkHarness, t *harnessTest) {
6986
6984
chanAmt = maxBtcFundingAmount
6987
6985
paymentAmt = 10000
6988
6986
numInvoices = 6
6989
- defaultCSV = uint32 (4 )
6990
6987
)
6991
6988
6992
6989
// Carol will be the up-to-date party. We set --nolisten to ensure Dave
@@ -8726,7 +8723,6 @@ func testMultiHopHtlcLocalTimeout(net *lntest.NetworkHarness, t *harnessTest) {
8726
8723
dustHtlcAmt = btcutil .Amount (100 )
8727
8724
htlcAmt = btcutil .Amount (30000 )
8728
8725
finalCltvDelta = 40
8729
- csvDelay = 4
8730
8726
)
8731
8727
alicePayStream , err := net .Alice .SendPayment (ctxb )
8732
8728
if err != nil {
@@ -8816,9 +8812,9 @@ func testMultiHopHtlcLocalTimeout(net *lntest.NetworkHarness, t *harnessTest) {
8816
8812
t .Fatalf ("htlc mismatch: %v" , predErr )
8817
8813
}
8818
8814
8819
- // We'll mine csvDelay blocks in order to generate the sweep transaction
8815
+ // We'll mine defaultCSV blocks in order to generate the sweep transaction
8820
8816
// of Bob's funding output.
8821
- if _ , err := net .Miner .Node .Generate (csvDelay ); err != nil {
8817
+ if _ , err := net .Miner .Node .Generate (defaultCSV ); err != nil {
8822
8818
t .Fatalf ("unable to generate blocks: %v" , err )
8823
8819
}
8824
8820
@@ -8829,7 +8825,7 @@ func testMultiHopHtlcLocalTimeout(net *lntest.NetworkHarness, t *harnessTest) {
8829
8825
8830
8826
// We'll now mine the remaining blocks to cause the HTLC itself to
8831
8827
// timeout.
8832
- if _ , err := net .Miner .Node .Generate (defaultBroadcastDelta - csvDelay ); err != nil {
8828
+ if _ , err := net .Miner .Node .Generate (defaultBroadcastDelta - defaultCSV ); err != nil {
8833
8829
t .Fatalf ("unable to generate blocks: %v" , err )
8834
8830
}
8835
8831
@@ -8943,8 +8939,6 @@ func testMultiHopReceiverChainClaim(net *lntest.NetworkHarness, t *harnessTest)
8943
8939
timeout := time .Duration (time .Second * 15 )
8944
8940
ctxb := context .Background ()
8945
8941
8946
- defaultCSV := uint32 (4 )
8947
-
8948
8942
// First, we'll create a three hop network: Alice -> Bob -> Carol, with
8949
8943
// Carol refusing to actually settle or directly cancel any HTLC's
8950
8944
// self.
@@ -9184,7 +9178,6 @@ func testMultiHopLocalForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
9184
9178
// to Carol. As Carol is in hodl mode, she won't settle this HTLC which
9185
9179
// opens up the base for out tests.
9186
9180
const (
9187
- csvDelay = 4
9188
9181
finalCltvDelta = 40
9189
9182
htlcAmt = btcutil .Amount (30000 )
9190
9183
)
@@ -9259,9 +9252,9 @@ func testMultiHopLocalForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
9259
9252
t .Fatalf (predErr .Error ())
9260
9253
}
9261
9254
9262
- // We'll mine csvDelay blocks in order to generate the sweep transaction
9255
+ // We'll mine defaultCSV blocks in order to generate the sweep transaction
9263
9256
// of Bob's funding output.
9264
- if _ , err := net .Miner .Node .Generate (csvDelay ); err != nil {
9257
+ if _ , err := net .Miner .Node .Generate (defaultCSV ); err != nil {
9265
9258
t .Fatalf ("unable to generate blocks: %v" , err )
9266
9259
}
9267
9260
@@ -9272,7 +9265,7 @@ func testMultiHopLocalForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
9272
9265
9273
9266
// We'll now mine enough blocks for the HTLC to expire. After this, Bob
9274
9267
// should hand off the now expired HTLC output to the utxo nursery.
9275
- if _ , err := net .Miner .Node .Generate (finalCltvDelta - csvDelay - 1 ); err != nil {
9268
+ if _ , err := net .Miner .Node .Generate (finalCltvDelta - defaultCSV - 1 ); err != nil {
9276
9269
t .Fatalf ("unable to generate blocks: %v" , err )
9277
9270
}
9278
9271
@@ -9377,7 +9370,7 @@ func testMultiHopLocalForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
9377
9370
// We'll now mine 4 additional blocks. This should be enough for Bob's
9378
9371
// CSV timelock to expire and the sweeping transaction of the HTLC to be
9379
9372
// broadcast.
9380
- if _ , err := net .Miner .Node .Generate (csvDelay ); err != nil {
9373
+ if _ , err := net .Miner .Node .Generate (defaultCSV ); err != nil {
9381
9374
t .Fatalf ("unable to mine blocks: %v" , err )
9382
9375
}
9383
9376
@@ -9441,7 +9434,6 @@ func testMultiHopRemoteForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
9441
9434
// to Carol. As Carol is in hodl mode, she won't settle this HTLC which
9442
9435
// opens up the base for out tests.
9443
9436
const (
9444
- csvDelay = 4
9445
9437
finalCltvDelta = 40
9446
9438
htlcAmt = btcutil .Amount (30000 )
9447
9439
)
@@ -9641,8 +9633,6 @@ func testMultiHopHtlcLocalChainClaim(net *lntest.NetworkHarness, t *harnessTest)
9641
9633
timeout := time .Duration (time .Second * 15 )
9642
9634
ctxb := context .Background ()
9643
9635
9644
- defaultCSV := uint32 (4 )
9645
-
9646
9636
// First, we'll create a three hop network: Alice -> Bob -> Carol, with
9647
9637
// Carol refusing to actually settle or directly cancel any HTLC's
9648
9638
// self.
@@ -9775,7 +9765,7 @@ func testMultiHopHtlcLocalChainClaim(net *lntest.NetworkHarness, t *harnessTest)
9775
9765
}
9776
9766
9777
9767
// Keep track of the second level tx maturity.
9778
- carolSecondLevelCSV := defaultCSV
9768
+ carolSecondLevelCSV := uint32 ( defaultCSV )
9779
9769
9780
9770
// When Bob notices Carol's second level transaction in the block, he
9781
9771
// will extract the preimage and broadcast a second level tx to claim
@@ -9850,7 +9840,7 @@ func testMultiHopHtlcLocalChainClaim(net *lntest.NetworkHarness, t *harnessTest)
9850
9840
9851
9841
// Keep track of Bob's second level maturity, and decrement our track
9852
9842
// of Carol's.
9853
- bobSecondLevelCSV := defaultCSV
9843
+ bobSecondLevelCSV := uint32 ( defaultCSV )
9854
9844
carolSecondLevelCSV --
9855
9845
9856
9846
// If we then mine 3 additional blocks, Carol's second level tx should
@@ -9967,8 +9957,6 @@ func testMultiHopHtlcRemoteChainClaim(net *lntest.NetworkHarness, t *harnessTest
9967
9957
timeout := time .Duration (time .Second * 15 )
9968
9958
ctxb := context .Background ()
9969
9959
9970
- defaultCSV := uint32 (4 )
9971
-
9972
9960
// First, we'll create a three hop network: Alice -> Bob -> Carol, with
9973
9961
// Carol refusing to actually settle or directly cancel any HTLC's
9974
9962
// self.
@@ -10123,7 +10111,7 @@ func testMultiHopHtlcRemoteChainClaim(net *lntest.NetworkHarness, t *harnessTest
10123
10111
}
10124
10112
10125
10113
// Keep track of the second level tx maturity.
10126
- carolSecondLevelCSV := defaultCSV
10114
+ carolSecondLevelCSV := uint32 ( defaultCSV )
10127
10115
10128
10116
// When Bob notices Carol's second level transaction in the block, he
10129
10117
// will extract the preimage and broadcast a sweep tx to directly claim
0 commit comments