Skip to content

Commit 87fb185

Browse files
committed
sweepbatcher: remove const defaultBatchConfTarget
It is always overwritten with primary sweep's confTarget. Print a warning if batchConfTarget is 0 in updateRbfRate. See lightninglabs#754 (comment)
1 parent 40ad1ce commit 87fb185

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

sweepbatcher/sweep_batch.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ const (
3535
// fee rate is increased when an rbf is attempted.
3636
defaultFeeRateStep = chainfee.SatPerKWeight(100)
3737

38-
// defaultBatchConfTarget is the default confirmation target of the
39-
// batch transaction.
40-
defaultBatchConfTarget = 12
41-
4238
// batchConfHeight is the default confirmation height of the batch
4339
// transaction.
4440
batchConfHeight = 3
@@ -1059,6 +1055,10 @@ func (b *batch) updateRbfRate(ctx context.Context) error {
10591055
// If the feeRate is unset then we never published before, so we
10601056
// retrieve the fee estimate from our wallet.
10611057
if b.rbfCache.FeeRate == 0 {
1058+
if b.cfg.batchConfTarget == 0 {
1059+
b.log.Warnf("updateRbfRate called with zero " +
1060+
"batchConfTarget")
1061+
}
10621062
b.log.Infof("initializing rbf fee rate for conf target=%v",
10631063
b.cfg.batchConfTarget)
10641064
rate, err := b.wallet.EstimateFeeRate(

sweepbatcher/sweep_batcher.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,6 @@ func (b *Batcher) handleSweep(ctx context.Context, sweep *sweep,
378378
func (b *Batcher) spinUpBatch(ctx context.Context) (*batch, error) {
379379
cfg := batchConfig{
380380
maxTimeoutDistance: defaultMaxTimeoutDistance,
381-
batchConfTarget: defaultBatchConfTarget,
382381
}
383382

384383
switch b.chainParams {
@@ -488,7 +487,6 @@ func (b *Batcher) spinUpBatchFromDB(ctx context.Context, batch *batch) error {
488487

489488
cfg := batchConfig{
490489
maxTimeoutDistance: batch.cfg.maxTimeoutDistance,
491-
batchConfTarget: defaultBatchConfTarget,
492490
}
493491

494492
newBatch, err := NewBatchFromDB(cfg, batchKit)

0 commit comments

Comments
 (0)