mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-19 05:45:21 +01:00
multi: deprecate batchwindowduration
config option
This commit is contained in:
parent
c03509397f
commit
465332f409
@ -286,8 +286,6 @@ var bumpCloseFeeCommand = cli.Command{
|
||||
to sweep the anchor outputs of the closing transaction at the requested
|
||||
fee rate or confirmation target. The specified fee rate will be the
|
||||
effective fee rate taking the parent fee into account.
|
||||
Depending on the sweeper configuration (batchwindowduration) the sweeptx
|
||||
will not be published immediately.
|
||||
NOTE: This cmd is DEPRECATED please use bumpforceclosefee instead.
|
||||
`,
|
||||
Flags: []cli.Flag{
|
||||
@ -321,8 +319,6 @@ var bumpForceCloseFeeCommand = cli.Command{
|
||||
to sweep the anchor outputs of the closing transaction at the requested
|
||||
fee rate or confirmation target. The specified fee rate will be the
|
||||
effective fee rate taking the parent fee into account.
|
||||
Depending on the sweeper configuration (batchwindowduration) the sweeptx
|
||||
will not be published immediately.
|
||||
`,
|
||||
Flags: []cli.Flag{
|
||||
cli.Uint64Flag{
|
||||
|
@ -690,8 +690,7 @@ func DefaultConfig() Config {
|
||||
Timeout: lncfg.DefaultRemoteSignerRPCTimeout,
|
||||
},
|
||||
Sweeper: &lncfg.Sweeper{
|
||||
BatchWindowDuration: sweep.DefaultBatchWindowDuration,
|
||||
MaxFeeRate: sweep.DefaultMaxFeeRate,
|
||||
MaxFeeRate: sweep.DefaultMaxFeeRate,
|
||||
},
|
||||
Htlcswitch: &lncfg.Htlcswitch{
|
||||
MailboxDeliveryTimeout: htlcswitch.DefaultMailboxDeliveryTimeout,
|
||||
|
@ -19,7 +19,7 @@ const (
|
||||
|
||||
//nolint:lll
|
||||
type Sweeper struct {
|
||||
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."`
|
||||
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"`
|
||||
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."`
|
||||
}
|
||||
|
||||
|
@ -1612,8 +1612,9 @@
|
||||
|
||||
[sweeper]
|
||||
|
||||
; 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.
|
||||
; DEPRECATED: 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.
|
||||
; sweeper.batchwindowduration=30s
|
||||
|
||||
; The max fee rate in sat/vb which can be used when sweeping funds. Setting
|
||||
|
@ -1052,9 +1052,6 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
srvrLog.Debugf("Sweeper batch window duration: %v",
|
||||
cfg.Sweeper.BatchWindowDuration)
|
||||
|
||||
sweeperStore, err := sweep.NewSweeperStore(
|
||||
dbs.ChanStateDB, s.cfg.ActiveNetParams.GenesisHash,
|
||||
)
|
||||
@ -1073,7 +1070,6 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
GenSweepScript: newSweepPkScriptGen(cc.Wallet),
|
||||
Signer: cc.Wallet.Cfg.Signer,
|
||||
Wallet: newSweeperWallet(cc.Wallet),
|
||||
TickerDuration: cfg.Sweeper.BatchWindowDuration,
|
||||
Mempool: cc.MempoolNotifier,
|
||||
Notifier: cc.ChainNotifier,
|
||||
Store: sweeperStore,
|
||||
|
@ -1,17 +1,10 @@
|
||||
package sweep
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
|
||||
)
|
||||
|
||||
var (
|
||||
// DefaultBatchWindowDuration specifies 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.
|
||||
DefaultBatchWindowDuration = 30 * time.Second
|
||||
|
||||
// DefaultMaxFeeRate is the default maximum fee rate allowed within the
|
||||
// UtxoSweeper. The current value is equivalent to a fee rate of 1,000
|
||||
// sat/vbyte.
|
||||
|
@ -5,7 +5,6 @@ import (
|
||||
"fmt"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/btcsuite/btcd/btcutil"
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
@ -318,12 +317,6 @@ type UtxoSweeperConfig struct {
|
||||
// Wallet contains the wallet functions that sweeper requires.
|
||||
Wallet Wallet
|
||||
|
||||
// TickerDuration is used to create a channel that will be sent on when
|
||||
// a certain time window has passed. During this time window, new
|
||||
// inputs can still be added to the sweep tx that is about to be
|
||||
// generated.
|
||||
TickerDuration time.Duration
|
||||
|
||||
// Notifier is an instance of a chain notifier we'll use to watch for
|
||||
// certain on-chain events.
|
||||
Notifier chainntnfs.ChainNotifier
|
||||
|
@ -138,11 +138,10 @@ func createSweeperTestContext(t *testing.T) *sweeperTestContext {
|
||||
}
|
||||
|
||||
ctx.sweeper = New(&UtxoSweeperConfig{
|
||||
Notifier: notifier,
|
||||
Wallet: backend,
|
||||
TickerDuration: 100 * time.Millisecond,
|
||||
Store: store,
|
||||
Signer: &lnmock.DummySigner{},
|
||||
Notifier: notifier,
|
||||
Wallet: backend,
|
||||
Store: store,
|
||||
Signer: &lnmock.DummySigner{},
|
||||
GenSweepScript: func() ([]byte, error) {
|
||||
script := make([]byte, input.P2WPKHSize)
|
||||
script[0] = 0
|
||||
|
Loading…
Reference in New Issue
Block a user