Skip to content

Commit 534c71b

Browse files
committed
sweepbatcher: minimumSweepFeeRate fixes confTarget
This is already done in GetConfTargetAndFeeRate. The fix is just a double check.
1 parent 8431784 commit 534c71b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

sweepbatcher/sweep_batcher.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,10 +1579,18 @@ func minimumSweepFeeRate(ctx context.Context, customFeeRate FeeRateProvider,
15791579
return minFeeRate, nil
15801580
}
15811581

1582-
if sweepConfTarget == 0 {
1583-
warnf("Fee estimation was requested for zero "+
1584-
"confTarget for sweep %x.", swapHash[:6])
1582+
// Make sure sweepConfTarget is at least 2. LND's walletkit fails with
1583+
// conftarget of 0 or 1.
1584+
// TODO: when https://github.com/lightningnetwork/lnd/pull/10087 is
1585+
// merged and that LND version becomes a requirement, we can decrease
1586+
// this from 2 to 1.
1587+
if sweepConfTarget < 2 {
1588+
warnf("Fee estimation was requested for confTarget=%d for "+
1589+
"sweep %x; changing confTarget to 2", sweepConfTarget,
1590+
swapHash[:6])
1591+
sweepConfTarget = 2
15851592
}
1593+
15861594
minFeeRate, err := wallet.EstimateFeeRate(ctx, sweepConfTarget)
15871595
if err != nil {
15881596
return 0, fmt.Errorf("failed to estimate fee rate "+

0 commit comments

Comments
 (0)