@@ -1224,8 +1224,8 @@ func testSweepHTLCs(ht *lntest.HarnessTest) {
1224
1224
// 4. Alice force closes the channel.
1225
1225
//
1226
1226
// Test:
1227
- // 1. Alice's anchor sweeping is not attempted, instead, it should be swept
1228
- // together with her to_local output using the no deadline path.
1227
+ // 1. Alice's CPFP- anchor sweeping is not attempted, instead, it should be
1228
+ // swept using the no deadline path and failed due it's not economical .
1229
1229
// 2. Bob would also sweep his anchor and to_local outputs separately due to
1230
1230
// they have different deadline heights, which means only the to_local
1231
1231
// sweeping tx will succeed as the anchor sweeping is not economical.
@@ -1241,10 +1241,15 @@ func testSweepCommitOutputAndAnchor(ht *lntest.HarnessTest) {
1241
1241
// config.
1242
1242
deadline := uint32 (1000 )
1243
1243
1244
- // deadlineA is the deadline used for Alice, since her commit output is
1245
- // offered to the sweeper at CSV-1. With a deadline of 1000, her actual
1246
- // width of her fee func is CSV+1000-1. Given we are using a CSV of 2
1247
- // here, her fee func deadline then becomes 1001.
1244
+ // deadlineA is the deadline used for Alice, given that,
1245
+ // - the force close tx is broadcast at height 445, her inputs are
1246
+ // registered at the same height, so her to_local and anchor outputs
1247
+ // have a deadline height of 1445.
1248
+ // - the force close tx is mined at 446, which means her anchor output
1249
+ // now has a deadline delta of (1445-446) = 999 blocks.
1250
+ // - for her to_local output, with a deadline of 1000, the width of the
1251
+ // fee func is CSV+1000-1. Given we are using a CSV of 2 here, her fee
1252
+ // func deadline then becomes 1001.
1248
1253
deadlineA := deadline + 1
1249
1254
1250
1255
// deadlineB is the deadline used for Bob, the actual deadline used by
@@ -1267,6 +1272,11 @@ func testSweepCommitOutputAndAnchor(ht *lntest.HarnessTest) {
1267
1272
// conf target is the deadline.
1268
1273
ht .SetFeeEstimateWithConf (startFeeRate , deadlineB )
1269
1274
1275
+ // Set up the starting fee for Alice's anchor sweeping. With this low
1276
+ // fee rate, her anchor sweeping should be attempted and failed due to
1277
+ // dust output generated in the sweeping tx.
1278
+ ht .SetFeeEstimateWithConf (startFeeRate , deadline - 1 )
1279
+
1270
1280
// toLocalCSV is the CSV delay for Alice's to_local output. We use a
1271
1281
// small value to save us from mining blocks.
1272
1282
//
0 commit comments