@@ -18,7 +18,7 @@ const (
18
18
highFeeRate = chainfee .SatPerKWeight (30000 )
19
19
20
20
coopInputWeight = lntypes .WeightUnit (230 )
21
- nonCoopInputWeight = lntypes .WeightUnit (521 )
21
+ nonCoopInputWeight = lntypes .WeightUnit (393 )
22
22
nonCoopPenalty = nonCoopInputWeight - coopInputWeight
23
23
coopNewBatchWeight = lntypes .WeightUnit (444 )
24
24
nonCoopNewBatchWeight = coopNewBatchWeight + nonCoopPenalty
@@ -31,7 +31,7 @@ const (
31
31
coopTwoSweepBatchWeight = coopNewBatchWeight + coopInputWeight
32
32
nonCoopTwoSweepBatchWeight = coopTwoSweepBatchWeight +
33
33
2 * nonCoopPenalty
34
- v2v3BatchWeight = nonCoopTwoSweepBatchWeight - 153
34
+ v2v3BatchWeight = nonCoopTwoSweepBatchWeight - 25
35
35
)
36
36
37
37
// testHtlcV2SuccessEstimator adds weight of non-cooperative input to estimator
@@ -523,6 +523,37 @@ func TestSelectBatches(t *testing.T) {
523
523
NonCoopWeight : nonCoopNewBatchWeight ,
524
524
NonCoopHint : true ,
525
525
},
526
+ wantBestBatchesIds : []int32 {2 , newBatchSignal , 1 },
527
+ },
528
+
529
+ {
530
+ name : "high fee noncoop sweep, large batches" ,
531
+ batches : []feeDetails {
532
+ {
533
+ BatchId : 1 ,
534
+ FeeRate : lowFeeRate ,
535
+ CoopWeight : 10000 ,
536
+ NonCoopWeight : 15000 ,
537
+ },
538
+ {
539
+ BatchId : 2 ,
540
+ FeeRate : highFeeRate ,
541
+ CoopWeight : 10000 ,
542
+ NonCoopWeight : 15000 ,
543
+ },
544
+ },
545
+ sweep : feeDetails {
546
+ FeeRate : highFeeRate ,
547
+ CoopWeight : coopInputWeight ,
548
+ NonCoopWeight : nonCoopInputWeight ,
549
+ NonCoopHint : true ,
550
+ },
551
+ oneSweepBatch : feeDetails {
552
+ FeeRate : highFeeRate ,
553
+ CoopWeight : coopNewBatchWeight ,
554
+ NonCoopWeight : nonCoopNewBatchWeight ,
555
+ NonCoopHint : true ,
556
+ },
526
557
wantBestBatchesIds : []int32 {newBatchSignal , 2 , 1 },
527
558
},
528
559
@@ -586,6 +617,37 @@ func TestSelectBatches(t *testing.T) {
586
617
NonCoopWeight : nonCoopNewBatchWeight ,
587
618
NonCoopHint : true ,
588
619
},
620
+ wantBestBatchesIds : []int32 {1 , newBatchSignal , 2 },
621
+ },
622
+
623
+ {
624
+ name : "low fee noncoop sweep, large batches" ,
625
+ batches : []feeDetails {
626
+ {
627
+ BatchId : 1 ,
628
+ FeeRate : lowFeeRate ,
629
+ CoopWeight : 10000 ,
630
+ NonCoopWeight : 15000 ,
631
+ },
632
+ {
633
+ BatchId : 2 ,
634
+ FeeRate : highFeeRate ,
635
+ CoopWeight : 10000 ,
636
+ NonCoopWeight : 15000 ,
637
+ },
638
+ },
639
+ sweep : feeDetails {
640
+ FeeRate : lowFeeRate ,
641
+ CoopWeight : coopInputWeight ,
642
+ NonCoopWeight : nonCoopInputWeight ,
643
+ NonCoopHint : true ,
644
+ },
645
+ oneSweepBatch : feeDetails {
646
+ FeeRate : lowFeeRate ,
647
+ CoopWeight : coopNewBatchWeight ,
648
+ NonCoopWeight : nonCoopNewBatchWeight ,
649
+ NonCoopHint : true ,
650
+ },
589
651
wantBestBatchesIds : []int32 {newBatchSignal , 1 , 2 },
590
652
},
591
653
0 commit comments