Skip to content

Commit 0805488

Browse files
committed
multi: deprecate batchwindowduration config option
1 parent fcb1976 commit 0805488

8 files changed

+9
-32
lines changed

cmd/lncli/walletrpc_active.go

-4
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,6 @@ var bumpCloseFeeCommand = cli.Command{
286286
to sweep the anchor outputs of the closing transaction at the requested
287287
fee rate or confirmation target. The specified fee rate will be the
288288
effective fee rate taking the parent fee into account.
289-
Depending on the sweeper configuration (batchwindowduration) the sweeptx
290-
will not be published immediately.
291289
NOTE: This cmd is DEPRECATED please use bumpforceclosefee instead.
292290
`,
293291
Flags: []cli.Flag{
@@ -321,8 +319,6 @@ var bumpForceCloseFeeCommand = cli.Command{
321319
to sweep the anchor outputs of the closing transaction at the requested
322320
fee rate or confirmation target. The specified fee rate will be the
323321
effective fee rate taking the parent fee into account.
324-
Depending on the sweeper configuration (batchwindowduration) the sweeptx
325-
will not be published immediately.
326322
`,
327323
Flags: []cli.Flag{
328324
cli.Uint64Flag{

config.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,7 @@ func DefaultConfig() Config {
689689
Timeout: lncfg.DefaultRemoteSignerRPCTimeout,
690690
},
691691
Sweeper: &lncfg.Sweeper{
692-
BatchWindowDuration: sweep.DefaultBatchWindowDuration,
693-
MaxFeeRate: sweep.DefaultMaxFeeRate,
692+
MaxFeeRate: sweep.DefaultMaxFeeRate,
694693
},
695694
Htlcswitch: &lncfg.Htlcswitch{
696695
MailboxDeliveryTimeout: htlcswitch.DefaultMailboxDeliveryTimeout,

lncfg/sweeper.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const (
1919

2020
//nolint:lll
2121
type Sweeper struct {
22-
BatchWindowDuration time.Duration `long:"batchwindowduration" description:"Duration of the sweep batch window. The sweep is held back during the batch window to allow more inputs to be added and thereby lower the fee per input."`
22+
BatchWindowDuration time.Duration `long:"batchwindowduration" description:"Duration of the sweep batch window. The sweep is held back during the batch window to allow more inputs to be added and thereby lower the fee per input." hidden:"true"`
2323
MaxFeeRate chainfee.SatPerVByte `long:"maxfeerate" description:"Maximum fee rate in sat/vb that the sweeper is allowed to use when sweeping funds. Setting this value too low can result in transactions not being confirmed in time, causing HTLCs to expire hence potentially losing funds."`
2424
}
2525

sample-lnd.conf

+3-2
Original file line numberDiff line numberDiff line change
@@ -1609,8 +1609,9 @@
16091609

16101610
[sweeper]
16111611

1612-
; Duration of the sweep batch window. The sweep is held back during the batch
1613-
; window to allow more inputs to be added and thereby lower the fee per input.
1612+
; DEPRECATED: Duration of the sweep batch window. The sweep is held back during
1613+
; the batch window to allow more inputs to be added and thereby lower the fee
1614+
; per input.
16141615
; sweeper.batchwindowduration=30s
16151616

16161617
; The max fee rate in sat/vb which can be used when sweeping funds. Setting

server.go

-4
Original file line numberDiff line numberDiff line change
@@ -1052,9 +1052,6 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
10521052
return nil, err
10531053
}
10541054

1055-
srvrLog.Debugf("Sweeper batch window duration: %v",
1056-
cfg.Sweeper.BatchWindowDuration)
1057-
10581055
sweeperStore, err := sweep.NewSweeperStore(
10591056
dbs.ChanStateDB, s.cfg.ActiveNetParams.GenesisHash,
10601057
)
@@ -1073,7 +1070,6 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
10731070
GenSweepScript: newSweepPkScriptGen(cc.Wallet),
10741071
Signer: cc.Wallet.Cfg.Signer,
10751072
Wallet: newSweeperWallet(cc.Wallet),
1076-
TickerDuration: cfg.Sweeper.BatchWindowDuration,
10771073
Mempool: cc.MempoolNotifier,
10781074
Notifier: cc.ChainNotifier,
10791075
Store: sweeperStore,

sweep/defaults.go

-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
package sweep
22

33
import (
4-
"time"
5-
64
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
75
)
86

97
var (
10-
// DefaultBatchWindowDuration specifies duration of the sweep batch
11-
// window. The sweep is held back during the batch window to allow more
12-
// inputs to be added and thereby lower the fee per input.
13-
DefaultBatchWindowDuration = 30 * time.Second
14-
158
// DefaultMaxFeeRate is the default maximum fee rate allowed within the
169
// UtxoSweeper. The current value is equivalent to a fee rate of 1,000
1710
// sat/vbyte.

sweep/sweeper.go

-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"fmt"
66
"sync"
77
"sync/atomic"
8-
"time"
98

109
"github.com/btcsuite/btcd/btcutil"
1110
"github.com/btcsuite/btcd/chaincfg/chainhash"
@@ -318,12 +317,6 @@ type UtxoSweeperConfig struct {
318317
// Wallet contains the wallet functions that sweeper requires.
319318
Wallet Wallet
320319

321-
// TickerDuration is used to create a channel that will be sent on when
322-
// a certain time window has passed. During this time window, new
323-
// inputs can still be added to the sweep tx that is about to be
324-
// generated.
325-
TickerDuration time.Duration
326-
327320
// Notifier is an instance of a chain notifier we'll use to watch for
328321
// certain on-chain events.
329322
Notifier chainntnfs.ChainNotifier

sweep/sweeper_test.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,10 @@ func createSweeperTestContext(t *testing.T) *sweeperTestContext {
138138
}
139139

140140
ctx.sweeper = New(&UtxoSweeperConfig{
141-
Notifier: notifier,
142-
Wallet: backend,
143-
TickerDuration: 100 * time.Millisecond,
144-
Store: store,
145-
Signer: &lnmock.DummySigner{},
141+
Notifier: notifier,
142+
Wallet: backend,
143+
Store: store,
144+
Signer: &lnmock.DummySigner{},
146145
GenSweepScript: func() ([]byte, error) {
147146
script := make([]byte, input.P2WPKHSize)
148147
script[0] = 0

0 commit comments

Comments
 (0)