Skip to content

Commit 3268f0c

Browse files
committed
sweepbatcher: remove const defaultBatchConfTarget
It is always overwritten with primary sweep's confTarget. See lightninglabs#754 (comment)
1 parent c4ec1cb commit 3268f0c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

sweepbatcher/sweep_batch.go

Lines changed: 6 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
@@ -1057,6 +1053,12 @@ func (b *batch) updateRbfRate(ctx context.Context) error {
10571053
// If the feeRate is unset then we never published before, so we
10581054
// retrieve the fee estimate from our wallet.
10591055
if b.rbfCache.FeeRate == 0 {
1056+
if b.cfg.batchConfTarget == 0 {
1057+
// This must never happen, since batchConfTarget
1058+
// is set in addSweep and in NewBatchFromDB.
1059+
return fmt.Errorf("updateRbfRate called with zero " +
1060+
"batchConfTarget")
1061+
}
10601062
b.log.Infof("initializing rbf fee rate for conf target=%v",
10611063
b.cfg.batchConfTarget)
10621064
rate, err := b.wallet.EstimateFeeRate(

sweepbatcher/sweep_batcher.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,6 @@ func (b *Batcher) handleSweep(ctx context.Context, sweep *sweep,
375375
func (b *Batcher) spinUpBatch(ctx context.Context) (*batch, error) {
376376
cfg := batchConfig{
377377
maxTimeoutDistance: defaultMaxTimeoutDistance,
378-
batchConfTarget: defaultBatchConfTarget,
379378
}
380379

381380
switch b.chainParams {
@@ -485,7 +484,6 @@ func (b *Batcher) spinUpBatchFromDB(ctx context.Context, batch *batch) error {
485484

486485
cfg := batchConfig{
487486
maxTimeoutDistance: batch.cfg.maxTimeoutDistance,
488-
batchConfTarget: defaultBatchConfTarget,
489487
}
490488

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

0 commit comments

Comments
 (0)